Gathering detailed insights and metrics for meow-helper
Gathering detailed insights and metrics for meow-helper
Gathering detailed insights and metrics for meow-helper
Gathering detailed insights and metrics for meow-helper
npm install meow-helper
Typescript
Module System
Min. Node Version
Node Version
NPM Version
71
Supply Chain
99.4
Quality
75.5
Maintenance
100
Vulnerability
100
License
TypeScript (55.72%)
JavaScript (43.38%)
Shell (0.9%)
Total Downloads
5,805
Last Day
4
Last Week
59
Last Month
293
Last Year
1,229
24 Commits
2 Watching
1 Branches
1 Contributors
Minified
Minified + Gzipped
Latest Version
1.6.2
Package Id
meow-helper@1.6.2
Unpacked Size
269.50 kB
Size
146.64 kB
File Count
22
NPM Version
6.14.11
Node Version
14.16.0
Cumulative downloads
Total Downloads
Last day
-88.9%
4
Compared to previous day
Last week
-47.3%
59
Compared to previous week
Last month
103.5%
293
Compared to previous month
Last year
24.4%
1,229
Compared to previous year
33
--help
and --version
)meow
throws unknown flags with the allowUnknownFlags
option. meow-helper
shows help text instead of throwing. You can change this behavior with the notThrow
option.*
.multilineThreshold
option.$
before command.{ autoHelp: true }
and { autoHelp: false }
. Adds a description to help if required.args: { “path...” }
becomes command <path>...
...
to flags with multiple value.TypeScript
1import getHelp, { commonFlags, chalk, cliui } from "meow-helper"; 2import type { ExtendedAnyFlags } from "meow-helper"; 3import { readFileSync } from "fs"; 4import { join } from "path";
CommonJS
1const { default: getHelp, commonFlags, chalk, cliui } = require("meow-helper"); 2const { readFileSync } = require("fs");
Usage
1const flags: ExtendedAnyFlags = { 2 name: { alias: "n", type: "string", desc: "Name" }, 3 cwd: { alias: "c", type: "string", desc: "Working path." }, 4 context: { type: "string", desc: "Context." }, 5 ...commonFlags, 6}; 7 8// Groups options. Keys are the first option of the group. 9const groups = { 10 name: { title: "General Options", description: "Some description" }, 11 context: { title: "Other Options", description: "Other description" }, 12}; 13 14const args = { "path...": "Paths of files." }; 15const pkg = JSON.parse(readFileSync(join(__dirname, "../package.json"), { encoding: "utf8" })); 16 17meow(getHelp({ flags, args, groups, pkg }), { flags, pkg, allowUnknownFlags: false });
1const help = getHelp({
2 lineLength: 80,
3 titleLength: 15,
4 pkg: {}, // package.json data
5 command: "not-sync",
6 description: "Description of the command",
7 args: { path: "Path of file." },
8 flags, // meow flags with `desc` key.
9 examples: ["not-sync node_modules,dist,coverage", "not-sync node_modules,dist,coverage --ignoreConfigs .gitignore"],
10 multilineThreshold: 50,
11 autoHelp: true,
12 notThrow: true,
13});
meow-helper
generates single-line or multi-line help text based on the multilineThreshold
option automatically.
Ƭ ExtendedAnyFlag: AnyFlag & { desc?
: string }
Meow flag extended with desc
key.
Defined in: get-help.ts:8
Ƭ ExtendedAnyFlags: Record<string, ExtendedAnyFlag>
Record of extended any flag.
Defined in: get-help.ts:11
• Const
cliui: any
Defined in: index.ts:5
• Const
commonFlags: ExtendedAnyFlags
Very common flags
Defined in: index.ts:12
▸ default(helpOptions
: HelpOptions): string
Generate help text for meow.
1const flags: ExtendedFlags = { cwd: { alias: "c", type: "string", desc: "Current CWD." }, ...commonFlags }; 2const args = { path: "Path of file." }; 3 4meow(getHelp({ flags, args, pkg }), { flags, pkg, allowUnknownFlags: false });
Name | Type | Description |
---|---|---|
helpOptions | HelpOptions | are options |
Returns: string
Defined in: get-help.ts:193
meow-helper / HelpOptions
Options below modify behaviour of [[getHelp]] function.
• Optional
args: Record<string, string>
Name and description of positional arguments.
Defined in: get-help.ts:28
• Optional
autoHelp: boolean
This option sets whether the autoHelp
option of meow
is used. If this is true, the description text is not added, because meow adds it automatically.
Defined in: get-help.ts:36
• Optional
command: string
Name of the command.
Defined in: get-help.ts:22
• Optional
description: string | string[]
Command description.
Defined in: get-help.ts:24
• Optional
examples: string | string[]
A single example or list of examples can be provided to show in the help text. Lines are prefixed with $
and the command is colored automatically.
Defined in: get-help.ts:32
• Optional
flags: ExtendedAnyFlags
Flags provided to meow. Uses desc
key for the description.
Defined in: get-help.ts:30
• Optional
groups: Record<string, { description?
: string ; title?
: string }>
Option groups shown in help text. Key is the first option in group.
Defined in: get-help.ts:40
• Optional
lineLength: number
Text longer than line length will be word-wrapped.
Defined in: get-help.ts:16
• Optional
multilineThreshold: number
If space available for option descriptions is less than this threshold, descriptions are given their own rows. So they have more space. See images above.
Defined in: get-help.ts:34
• Optional
notThrow: boolean
Whether to throw an error when meow
exits with exit code 2. If true, it adds process.on("exit")
to show help and exits with code 0.
Defined in: get-help.ts:38
• Optional
pkg: Record<string, any>
package.json
data.
Defined in: get-help.ts:20
• Optional
titleLength: number
The total length of the colored background area of titles.
Defined in: get-help.ts:18
• Optional
usage: string | string[]
Uasge text is shown at the beginning of help text. Lines are prefixed with $
and command is colored automatically.
Defined in: get-help.ts:26
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
license file detected
Details
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
Found 0/24 approved changesets -- score normalized to 0
Reason
no SAST tool detected
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
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
43 existing vulnerabilities detected
Details
Score
Last Scanned on 2024-12-23
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