Gathering detailed insights and metrics for meow
Gathering detailed insights and metrics for meow
Gathering detailed insights and metrics for meow
Gathering detailed insights and metrics for meow
@types/meow
Stub TypeScript definitions entry for meow, which provides its own types definitions
cli-meow-help
Generate automatically formatted help text for `meow` CLI helper
meow-angular
Meow应用框架Meow.Ui.Angular库配套的ts代码库
@fontsource/meow-script
Self-host the Meow Script font in a neatly bundled NPM package.
npm install meow
Typescript
Module System
Min. Node Version
Node Version
NPM Version
95.7
Supply Chain
99.6
Quality
77.8
Maintenance
100
Vulnerability
99.6
License
JavaScript (88.73%)
TypeScript (11.27%)
Total Downloads
4,995,478,984
Last Day
1,020,366
Last Week
13,703,125
Last Month
86,613,599
Last Year
1,012,603,476
3,558 Stars
198 Commits
151 Forks
23 Watching
1 Branches
44 Contributors
Latest Version
13.2.0
Package Id
meow@13.2.0
Unpacked Size
409.28 kB
Size
88.90 kB
File Count
11
NPM Version
9.2.0
Node Version
20.11.0
Publised On
06 Feb 2024
Cumulative downloads
Total Downloads
Last day
-73.4%
1,020,366
Compared to previous day
Last week
-33.1%
13,703,125
Compared to previous week
Last month
-13.1%
86,613,599
Compared to previous month
Last year
9.3%
1,012,603,476
Compared to previous year
27
CLI app helper
I would recommend reading this guide on how to make user-friendly command-line tools.
--no-
prefix--version
--help
1npm install meow
1./foo-app.js unicorns --rainbow
1#!/usr/bin/env node 2import meow from 'meow'; 3import foo from './lib/index.js'; 4 5const cli = meow(` 6 Usage 7 $ foo <input> 8 9 Options 10 --rainbow, -r Include a rainbow 11 12 Examples 13 $ foo unicorns --rainbow 14 🌈 unicorns 🌈 15`, { 16 importMeta: import.meta, 17 flags: { 18 rainbow: { 19 type: 'boolean', 20 shortFlag: 'r' 21 } 22 } 23}); 24/* 25{ 26 input: ['unicorns'], 27 flags: {rainbow: true}, 28 ... 29} 30*/ 31 32foo(cli.input.at(0), cli.flags);
Returns an object
with:
input
(Array) - Non-flag argumentsflags
(Object) - Flags converted to camelCase excluding aliasesunnormalizedFlags
(Object) - Flags converted to camelCase including aliasespkg
(Object) - The package.json
objecthelp
(string) - The help text used with --help
showHelp([exitCode=2])
(Function) - Show the help text and exit with exitCode
showVersion()
(Function) - Show the version text and exitType: string
Shortcut for the help
option.
Type: object
Type: object
Pass in import.meta
. This is used to find the correct package.json file.
Type: object
Define argument flags.
The key is the flag name in camel-case and the value is an object with any of:
type
: Type of value. (Possible values: string
boolean
number
)choices
: Limit valid values to a predefined set of choices.default
: Default value when the flag is not specified.shortFlag
: A short flag alias.aliases
: Other names for the flag.isMultiple
: Indicates a flag can be set multiple times. Values are turned into an array. (Default: false)
$ foo -u rainbow -u cat
. Space- or comma-separated values are currently not supported.isRequired
: Determine if the flag is required. (Default: false)
Function
instead of a boolean
, which based on the given flags and other non-flag arguments, should decide if the flag is required. Two arguments are passed to the function:boolean
, true if the flag is required, otherwise false.Note that flags are always defined using a camel-case key (myKey
), but will match arguments in kebab-case (--my-key
).
Example:
1flags: { 2 unicorn: { 3 type: 'string', 4 choices: ['rainbow', 'cat', 'unicorn'], 5 default: ['rainbow', 'cat'], 6 shortFlag: 'u', 7 aliases: ['unicorns'], 8 isMultiple: true, 9 isRequired: (flags, input) => { 10 if (flags.otherFlag) { 11 return true; 12 } 13 14 return false; 15 } 16 } 17}
Type: string | boolean
Default: The package.json "description"
property
Description to show above the help text.
Set it to false
to disable it altogether.
Type: string | boolean
The help text you want shown.
The input is reindented and starting/ending newlines are trimmed which means you can use a template literal without having to care about using the correct amount of indent.
The description will be shown above your help text automatically.
Type: string | boolean
Default: The package.json "version"
property
Set a custom version output.
Type: boolean
Default: true
Automatically show the help text when the --help
flag is present. Useful to set this value to false
when a CLI manages child CLIs with their own help text.
This option is only considered when there is only one argument in process.argv
.
Type: boolean
Default: true
Automatically show the version text when the --version
flag is present. Useful to set this value to false
when a CLI manages child CLIs with their own version text.
This option is only considered when there is only one argument in process.argv
.
Type: object
Default: Closest package.json upwards
package.json as an object
.
Note: Setting this stops meow
from finding a package.json.
You most likely don't need this option.
Type: string[]
Default: process.argv.slice(2)
Custom arguments object.
Type: boolean
Default: false
Infer the argument type.
By default, the argument 5
in $ foo 5
becomes a string. Enabling this would infer it as a number.
Type: boolean | null | undefined
Default: false
Value of boolean
flags not defined in argv
.
If set to undefined
, the flags not defined in argv
will be excluded from the result.
The default
value set in boolean
flags take precedence over booleanDefault
.
Note: If used in conjunction with isMultiple
, the default flag value is set to []
.
Caution: Explicitly specifying undefined
for booleanDefault
has different meaning from omitting key itself.
Example:
1import meow from 'meow'; 2 3const cli = meow(` 4 Usage 5 $ foo 6 7 Options 8 --rainbow, -r Include a rainbow 9 --unicorn, -u Include a unicorn 10 --no-sparkles Exclude sparkles 11 12 Examples 13 $ foo 14 🌈 unicorns✨🌈 15`, { 16 importMeta: import.meta, 17 booleanDefault: undefined, 18 flags: { 19 rainbow: { 20 type: 'boolean', 21 default: true, 22 shortFlag: 'r' 23 }, 24 unicorn: { 25 type: 'boolean', 26 default: false, 27 shortFlag: 'u' 28 }, 29 cake: { 30 type: 'boolean', 31 shortFlag: 'c' 32 }, 33 sparkles: { 34 type: 'boolean', 35 default: true 36 } 37 } 38}); 39/* 40{ 41 flags: { 42 rainbow: true, 43 unicorn: false, 44 sparkles: true 45 }, 46 unnormalizedFlags: { 47 rainbow: true, 48 r: true, 49 unicorn: false, 50 u: false, 51 sparkles: true 52 }, 53 … 54} 55*/
Type boolean
Default: true
Whether to allow unknown flags or not.
Type number
Default: 2
The number of spaces to use for indenting the help text.
Meow will make unhandled rejected promises fail hard instead of the default silent fail. Meaning you don't have to manually .catch()
promises used in your CLI.
See chalk
if you want to colorize the terminal output.
See get-stdin
if you want to accept input from stdin.
See conf
if you need to persist some data.
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
security policy file detected
Details
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
0 existing vulnerabilities detected
Reason
Found 17/30 approved changesets -- score normalized to 5
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2024-12-16
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More