help-me is a lightweight Node.js utility designed to simplify the creation and display of help messages for command-line interfaces. It serves as a direct partner for argument parsers like `minimist` and command dispatchers such as `commist`, allowing developers to define structured help documentation in simple text files. Currently at version 5.0.0, the package sees an active development and maintenance cadence, with recent updates focusing on modernizing its codebase and reducing dependencies, notably dropping `glob` in v5.0.0. Its primary differentiator lies in its straightforward, file-based approach to help documentation and its minimal API surface, making it an ideal choice for projects already leveraging `minimist` or `commist` that require a simple, declarative help system without the overhead of larger CLI frameworks.
npm install help-meVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to initialize `help-me` in an ESM module, dynamically create a documentation directory and a sample help file, and then display help messages for both existing and non-existent commands using top-level await.
Review help file path resolution and ensure no reliance on glob-like patterns. Update paths to be explicit or use alternative file discovery mechanisms if glob-like functionality is required.
Thoroughly test help file resolution and command matching logic after upgrading to v4.0.0 to ensure correct behavior, especially if previous versions relied on non-exact matching or implicit path resolution.
Ensure your `dir` option is an absolute file system path when using ESM. Use `import { join } from 'desm'` with `join(import.meta.url, 'your-doc-folder')` or manually construct the path with `fileURLToPath` and `dirname`.Verify that the `dir` option points to the correct directory containing your help files and that the requested command's help file exists (e.g., `command.txt` for `['command']`). Ensure file names match command arguments.
For CommonJS, use `const helpMe = require('help-me')` to get the default export function. For ESM, use `import { help } from 'help-me'` for the named export.