# meow-with-subcommands

> Helper for handling subcommands with meow

Latest version **1.3.0** (published 2023-12-17) · MIT license · 0 weekly downloads

## Install

```sh
npm install meow-with-subcommands
pnpm add meow-with-subcommands
yarn add meow-with-subcommands
bun add meow-with-subcommands
```

## Health

**Score 40/100 (D)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 1.3.0 |
| Published | 2023-12-17 |
| First published | 2023-12-15 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM |
| Node | >=18.0.0 |
| Dependencies | 1 |
| Unpacked size | 22.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Pelle Wessman |
| Maintainers | voxpelli |

## Links

- npm: https://www.npmjs.com/package/meow-with-subcommands
- Repository: https://github.com/voxpelli/meow-with-subcommands
- Homepage: http://github.com/voxpelli/meow-with-subcommands
- Issues: https://github.com/voxpelli/meow-with-subcommands/issues
- npm.io page: https://npm.io/package/meow-with-subcommands

## Dependencies (1)

- [meow](https://npm.io/package/meow.md) ^12.1.1

## Recent versions

- 1.3.0 (latest) — 2023-12-17
- 1.2.0 — 2023-12-17
- 1.1.0 — 2023-12-16
- 1.0.1 — 2023-12-16
- 1.0.0 — 2023-12-15

## README

# meow-with-subcommands

Helper for handling subcommands with [meow](https://github.com/sindresorhus/meow)

[![npm version](https://img.shields.io/npm/v/meow-with-subcommands.svg?style=flat)](https://www.npmjs.com/package/meow-with-subcommands)
[![npm downloads](https://img.shields.io/npm/dm/meow-with-subcommands.svg?style=flat)](https://www.npmjs.com/package/meow-with-subcommands)
[![js-semistandard-style](https://img.shields.io/badge/code%20style-semistandard-brightgreen.svg)](https://github.com/voxpelli/eslint-config)
[![Module type: ESM](https://img.shields.io/badge/module%20type-esm-brightgreen)](https://github.com/voxpelli/badges-cjs-esm)
[![Types in JS](https://img.shields.io/badge/types_in_js-yes-brightgreen)](https://github.com/voxpelli/types-in-js)
[![Follow @voxpelli@mastodon.social](https://img.shields.io/mastodon/follow/109247025527949675?domain=https%3A%2F%2Fmastodon.social&style=social)](https://mastodon.social/@voxpelli)

## Usage

### Basic

<!--
TODO: Include this example using eg: https://unifiedjs.com/explore/package/remark-usage/
-->

```javascript
import { meowWithSubcommands } from 'meow-with-subcommands';

await meowWithSubcommands(
  {
    foo: {
      description: 'Do something very foo-like',
      async run (argv, importMeta, { parentName }) {
        // Do whatever you like, eg. initiate a new meow or meow-with-subcommands
      }
    }
  },
  {
    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`](./example/)-folder

## API

<!--
TODO: Generate these docs from the JSDoc instead
-->

### `meowWithSubcommands(commands, { [aliases], argv, name, ...meowOptions }) => Promise<void>`

### `prepareFlags`

### `printFlagList`

### `printHelpList`

## Extracted from

* [`SocketDev/socket-cli-js`](https://github.com/SocketDev/socket-cli-js/tree/535a68eb12f46ba20010c1db795a04a7593ec4a5) – I found the pattern I created for this open source CLI to be quite helpful and wanted to reuse it

## See also

* [`meow`](https://github.com/sindresorhus/meow)

---
_Source: https://npm.io/package/meow-with-subcommands · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
