Installations
npm install meow-helper
Developer Guide
Typescript
Yes
Module System
CommonJS
Min. Node Version
>= 14.0.0
Node Version
14.16.0
NPM Version
6.14.11
Score
71
Supply Chain
99.4
Quality
75.5
Maintenance
100
Vulnerability
100
License
Releases
Contributors
Unable to fetch Contributors
Languages
TypeScript (55.72%)
JavaScript (43.38%)
Shell (0.9%)
Developer
ozum
Download Statistics
Total Downloads
5,805
Last Day
4
Last Week
59
Last Month
293
Last Year
1,229
GitHub Statistics
24 Commits
2 Watching
1 Branches
1 Contributors
Bundle Size
28.53 kB
Minified
10.57 kB
Minified + Gzipped
Package Meta Information
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
Total Downloads
Cumulative downloads
Total Downloads
5,805
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
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
Dev Dependencies
33
Features
- Generates help text without effort. See images below.
- Provides common flags. (
--help
and--version
) meow
throws unknown flags with theallowUnknownFlags
option.meow-helper
shows help text instead of throwing. You can change this behavior with thenotThrow
option.- Formats, colorizes, and aligns arguments, options, default values, and their descriptions.
- Marks required fields with an
*
. - Supports maximum line length and automatic word wrap.
- Splits options into two lines if space for description is too small. You can change this behavior with the
multilineThreshold
option. - Generates description, usage, arguments, flags/options, examples sections.
- Colorizes command in usage and examples and adds
$
before command. - Exports chalk and cliui.
- Supports both
{ autoHelp: true }
and{ autoHelp: false }
. Adds a description to help if required. - Moves three dots in arguments outside of brackets. For example:
args: { “path...” }
becomescommand <path>...
- Adds three dots
...
to flags with multiple value.
Synopsis
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});
Details
meow-helper
generates single-line or multi-line help text based on the multilineThreshold
option automatically.
Single-Line
Multi-Line
API
Table of contents
Interfaces
Type aliases
ExtendedAnyFlag
Ƭ ExtendedAnyFlag: AnyFlag & { desc?
: string }
Meow flag extended with desc
key.
Defined in: get-help.ts:8
ExtendedAnyFlags
Ƭ ExtendedAnyFlags: Record<string, ExtendedAnyFlag>
Record of extended any flag.
Defined in: get-help.ts:11
Variables
cliui
• Const
cliui: any
Defined in: index.ts:5
commonFlags
• Const
commonFlags: ExtendedAnyFlags
Very common flags
Defined in: index.ts:12
Functions
default
▸ default(helpOptions
: HelpOptions): string
Generate help text for meow.
Example
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 });
Parameters:
Name | Type | Description |
---|---|---|
helpOptions | HelpOptions | are options |
Returns: string
Defined in: get-help.ts:193
Interfaces
meow-helper / HelpOptions
Interface: HelpOptions
Options below modify behaviour of [[getHelp]] function.
Properties
args
• Optional
args: Record<string, string>
Name and description of positional arguments.
Defined in: get-help.ts:28
autoHelp
• 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
command
• Optional
command: string
Name of the command.
Defined in: get-help.ts:22
description
• Optional
description: string | string[]
Command description.
Defined in: get-help.ts:24
examples
• 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
flags
• Optional
flags: ExtendedAnyFlags
Flags provided to meow. Uses desc
key for the description.
Defined in: get-help.ts:30
groups
• 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
lineLength
• Optional
lineLength: number
Text longer than line length will be word-wrapped.
Defined in: get-help.ts:16
multilineThreshold
• 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
notThrow
• 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
pkg
• Optional
pkg: Record<string, any>
package.json
data.
Defined in: get-help.ts:20
titleLength
• Optional
titleLength: number
The total length of the colored background area of titles.
Defined in: get-help.ts:18
usage
• 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
- Info: project has a license file: LICENSE:0
- Info: FSF or OSI recognized license: MIT License: LICENSE:0
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
- Warn: no topLevel permission defined: .github/workflows/main.yml:1
- Info: no jobLevel write permissions found
Reason
Found 0/24 approved changesets -- score normalized to 0
Reason
no SAST tool detected
Details
- Warn: no pull requests merged into dev branch
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/main.yml:21: update your workflow using https://app.stepsecurity.io/secureworkflow/ozum/meow-helper/main.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/main.yml:23: update your workflow using https://app.stepsecurity.io/secureworkflow/ozum/meow-helper/main.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/main.yml:30: update your workflow using https://app.stepsecurity.io/secureworkflow/ozum/meow-helper/main.yml/master?enable=pin
- Info: 0 out of 3 GitHub-owned GitHubAction dependencies pinned
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
- Warn: no security policy file detected
- Warn: no security file to analyze
- Warn: no security file to analyze
- Warn: no security file to analyze
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
branch protection not enabled on development/release branches
Details
- Warn: branch protection not enabled for branch 'master'
Reason
43 existing vulnerabilities detected
Details
- Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92
- Warn: Project is vulnerable to: GHSA-93q8-gq69-wqmw
- Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg
- Warn: Project is vulnerable to: GHSA-w8qv-6jwh-64r5
- Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275
- Warn: Project is vulnerable to: GHSA-w573-4hg7-7wgq
- Warn: Project is vulnerable to: GHSA-pfrx-2q88-qq97
- Warn: Project is vulnerable to: GHSA-43f8-2h32-f4cj
- Warn: Project is vulnerable to: GHSA-rc47-6667-2j5j
- Warn: Project is vulnerable to: GHSA-78xj-cgh5-2h22
- Warn: Project is vulnerable to: GHSA-2p57-rm9w-gvfp
- Warn: Project is vulnerable to: GHSA-896r-f27r-55mw
- Warn: Project is vulnerable to: GHSA-9c47-m6qq-7p4h
- Warn: Project is vulnerable to: GHSA-5v2h-r2cx-5xgj
- Warn: Project is vulnerable to: GHSA-rrrm-qjm4-v8hf
- Warn: Project is vulnerable to: GHSA-7wpw-2hjm-89gp
- Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv
- Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3
- Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h
- Warn: Project is vulnerable to: GHSA-x77j-w7wf-fjmw
- Warn: Project is vulnerable to: GHSA-hj48-42vr-x3v9
- Warn: Project is vulnerable to: GHSA-hrpp-h998-j3pp
- Warn: Project is vulnerable to: GHSA-p8p7-x288-28g6
- Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw
- Warn: Project is vulnerable to: GHSA-4rq4-32rv-6wp6
- Warn: Project is vulnerable to: GHSA-64g7-mvw6-v9qj
- Warn: Project is vulnerable to: GHSA-vx3p-948g-6vhq
- Warn: Project is vulnerable to: GHSA-3jfq-g458-7qm9
- Warn: Project is vulnerable to: GHSA-r628-mhmh-qjhw
- Warn: Project is vulnerable to: GHSA-9r2w-394v-53qc
- Warn: Project is vulnerable to: GHSA-5955-9wpr-37jh
- Warn: Project is vulnerable to: GHSA-qq89-hq3f-393p
- Warn: Project is vulnerable to: GHSA-f5x3-32g6-xq36
- Warn: Project is vulnerable to: GHSA-jgrx-mgxx-jf9v
- Warn: Project is vulnerable to: GHSA-72xf-g2v4-qvf3
- Warn: Project is vulnerable to: GHSA-w5p7-h5w8-2hfq
- Warn: Project is vulnerable to: GHSA-7p7h-4mm5-852v
- Warn: Project is vulnerable to: GHSA-38fc-wpqx-33j7
- Warn: Project is vulnerable to: GHSA-cf4h-3jhx-xvhq
- Warn: Project is vulnerable to: GHSA-j8xg-fqg3-53r7
- Warn: Project is vulnerable to: GHSA-6fc8-4gx4-v693
- Warn: Project is vulnerable to: GHSA-3h5v-q93c-6h6q
- Warn: Project is vulnerable to: GHSA-c4w7-xm78-47vh
Score
2.5
/10
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