diff --git a/docs/modules/README.md b/docs/modules/README.md index 5c8dda3..d7615b2 100644 --- a/docs/modules/README.md +++ b/docs/modules/README.md @@ -24,6 +24,7 @@ ESLint plugin. - [`chalk`](./chalk.md) - [`clean-webpack-plugin`](./clean-webpack-plugin.md) - [`clipboardy`](./clipboardy.md) +- [`commander`](./commander.md) - [`collection-map`](./collection-map.md) - [`core-util-is`](./core-util-is.md) - [`cosmiconfig`](./cosmiconfig.md) @@ -77,6 +78,7 @@ ESLint plugin. - [`md5`](./md5.md) - [`mkdirp`](./mkdirp.md) - [`moment.js`](./moment.md) +- [`mri`](./parseargs.md) - [`npm-run-all`](./npm-run-all.md) - [`node-fetch`](./fetch.md) - [`node-telegram-bot-api`](./node-telegram-bot-api.md) diff --git a/docs/modules/commander.md b/docs/modules/commander.md new file mode 100644 index 0000000..9fe8080 --- /dev/null +++ b/docs/modules/commander.md @@ -0,0 +1,33 @@ +--- +description: Modern alternatives to packages for building CLI applications +--- + +# Replacements for CLI builders + +## `sade` + +[`sade`](https://github.com/lukeed/sade) is a small but powerful tool for building CLI applications for Node.js + +```ts +import sade from 'sade' + +const prog = sade('my-cli') + +prog + .version('1.0.5') + .option('--global, -g', 'An example global flag') + .option('-c, --config', 'Provide path to custom config', 'foo.config.js') + +prog + .command('build ') + .describe('Build the source directory. Expects an `index.js` entry file.') + .option('-o, --output', 'Change the name of the output file', 'bundle.js') + .example('build src build --global --config my-conf.js') + .example('build app public -o main.js') + .action((src, dest, opts) => { + console.log(`> building from ${src} to ${dest}`) + console.log('> these are extra opts', opts) + }) + +prog.parse(process.argv) +``` diff --git a/manifests/preferred.json b/manifests/preferred.json index c06ac71..a693a09 100644 --- a/manifests/preferred.json +++ b/manifests/preferred.json @@ -108,6 +108,12 @@ "replacements": ["util.styleText", "picocolors", "ansis"], "url": {"type": "e18e", "id": "chalk"} }, + "commander": { + "type": "module", + "moduleName": "commander", + "replacements": ["sade"], + "url": {"type": "e18e", "id": "commander"} + }, "copy-text-to-clipboard": { "type": "module", "moduleName": "copy-text-to-clipboard", @@ -2388,6 +2394,12 @@ "replacements": ["node:crypto"], "url": {"type": "e18e", "id": "md5"} }, + "meow": { + "type": "module", + "moduleName": "meow", + "replacements": ["sade"], + "url": {"type": "e18e", "id": "commander"} + }, "mkdirp": { "type": "module", "moduleName": "mkdirp", @@ -2713,6 +2725,12 @@ "moduleName": "xmldom", "replacements": ["@xmldom/xmldom"], "url": {"type": "e18e", "id": "xmldom"} + }, + "yargs": { + "type": "module", + "moduleName": "yargs", + "replacements": ["sade"], + "url": {"type": "e18e", "id": "commander"} } }, "replacements": { @@ -3390,6 +3408,12 @@ "url": {"type": "e18e", "id": "source-map-explorer"}, "replacementModule": "rollup-plugin-visualizer" }, + "sade": { + "id": "sade", + "type": "documented", + "url": {"type": "e18e", "id": "commander"}, + "replacementModule": "sade" + }, "smol-toml": { "id": "smol-toml", "type": "documented",