Skip to content

Helper for handling commands with peowly

License

Notifications You must be signed in to change notification settings

voxpelli/peowly-commands

Repository files navigation

peowly-commands

npm version npm downloads js-semistandard-style Module type: ESM Types in JS Follow @voxpelli@mastodon.social

Helper for handling commands with peowly

Usage

Basic

import { peowlyCommands } from 'peowly-commands';

await peowlyCommands(
  {
    foo: {
      description: 'Do something very foo-like',
      async run (argv, importMeta, { parentName }) {
        // Do whatever you like, eg. initiate a peowly, peowly-commands, meow or something else
      }
    }
  },
  {
    aliases: {
      fs: {
        description: 'Alias for "foo --strict"',
        argv: ['foo', '--strict']
      },
    },
    argv: process.argv.slice(2),
    name: 'name-of-cli',
    importMeta: import.meta
  }
)

Complete

See example-folder

peowlyCommands()

peowlyCommands(commands: CliCommands, options: CliOptions, meta?: PeowlyMeta | undefined): Promise<void>

Similar modules

  • argsclopts – also concerned with helpers around parseArgs
  • meow – the inspiration for peowly – and name inspiration (p as in parseArgs, eow as in meow, ly to avoid being perceived as a typejacking)
  • meow-with-subcommands – the original version of this module and what evolved into peowly and peowly-commands
  • peowly – the parser module that this module builds on

See also

  • parseArgs() – the node.js API this module is built around. Available since v18.3.0 and v16.17.0, non-experimental since v20.0.0.

About

Helper for handling commands with peowly

Resources

License

Security policy

Stars

Watchers

Forks

Sponsor this project

 

Packages

No packages published