Skip to content

Commit

Permalink
Meta tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
sindresorhus committed Mar 19, 2020
1 parent 4527b45 commit 3f331d9
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 18 deletions.
2 changes: 1 addition & 1 deletion license
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@
"description": "CLI app helper",
"license": "MIT",
"repository": "sindresorhus/meow",
"funding": "https://github.com/sponsors/sindresorhus",
"author": {
"name": "Sindre Sorhus",
"email": "sindresorhus@gmail.com",
"url": "sindresorhus.com"
"url": "https://sindresorhus.com"
},
"engines": {
"node": ">=8"
Expand Down
25 changes: 9 additions & 16 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
![](meow.gif)


## Features

- Parses arguments
Expand All @@ -15,14 +14,12 @@
- Makes unhandled rejected promises [fail hard](https://github.com/sindresorhus/hard-rejection) instead of the default silent fail
- Sets the process title to the binary name defined in package.json


## Install

```
$ npm install meow
```


## Usage

```
Expand Down Expand Up @@ -64,7 +61,6 @@ const cli = meow(`
foo(cli.input[0], cli.flags);
```


## API

### meow(helpText, options?)
Expand Down Expand Up @@ -114,10 +110,9 @@ flags: {
}
```


##### description

Type: `string | boolean`<br>
Type: `string | boolean`\
Default: The package.json `"description"` property

Description to show above the help text.
Expand All @@ -136,14 +131,14 @@ The description will be shown above your help text automatically.

##### version

Type: `string | boolean`<br>
Type: `string | boolean`\
Default: The package.json `"version"` property

Set a custom version output.

##### autoHelp

Type: `boolean`<br>
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.
Expand All @@ -152,7 +147,7 @@ This option is only considered when there is only one argument in `process.argv`

##### autoVersion

Type: `boolean`<br>
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.
Expand All @@ -161,7 +156,7 @@ Automatically show the version text when the `--version` flag is present. Useful

##### pkg

Type: `object`<br>
Type: `object`\
Default: Closest package.json upwards

package.json as an `object`.
Expand All @@ -170,14 +165,14 @@ package.json as an `object`.

##### argv

Type: `string[]`<br>
Type: `string[]`\
Default: `process.argv.slice(2)`

Custom arguments object.

##### inferType

Type: `boolean`<br>
Type: `boolean`\
Default: `false`

Infer the argument type.
Expand All @@ -186,7 +181,7 @@ By default, the argument `5` in `$ foo 5` becomes a string. Enabling this would

##### booleanDefault

Type: `boolean | null | undefined`<br>
Type: `boolean | null | undefined`\
Default: `false`

Value of `boolean` flags not defined in `argv`.
Expand Down Expand Up @@ -254,7 +249,7 @@ const cli = meow(`

##### hardRejection

Type: `boolean`<br>
Type: `boolean`\
Default: `true`

Whether to use [`hard-rejection`](https://github.com/sindresorhus/hard-rejection) or not. Disabling this can be useful if you need to handle `process.on('unhandledRejection')` yourself.
Expand All @@ -263,7 +258,6 @@ Whether to use [`hard-rejection`](https://github.com/sindresorhus/hard-rejection

Meow will make unhandled rejected promises [fail hard](https://github.com/sindresorhus/hard-rejection) instead of the default silent fail. Meaning you don't have to manually `.catch()` promises used in your CLI.


## Tips

See [`chalk`](https://github.com/chalk/chalk) if you want to colorize the terminal output.
Expand All @@ -276,7 +270,6 @@ See [`update-notifier`](https://github.com/yeoman/update-notifier) if you want u

[More useful CLI utilities…](https://github.com/sindresorhus/awesome-nodejs#command-line-utilities)


---

<div align="center">
Expand Down

0 comments on commit 3f331d9

Please sign in to comment.