https://github.com/egoist/minimost
Like minimist but flags are converted to camelCase
https://github.com/egoist/minimost
argv cli minimist
Last synced: 15 days ago
JSON representation
Like minimist but flags are converted to camelCase
- Host: GitHub
- URL: https://github.com/egoist/minimost
- Owner: egoist
- License: mit
- Created: 2017-03-07T09:02:11.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2021-12-25T14:05:17.000Z (over 3 years ago)
- Last Synced: 2025-02-25T17:44:27.862Z (3 months ago)
- Topics: argv, cli, minimist
- Language: TypeScript
- Homepage:
- Size: 104 KB
- Stars: 11
- Watchers: 3
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# minimost
[](https://npmjs.com/package/minimost) [](https://npmjs.com/package/minimost) [](https://circleci.com/gh/egoist/minimost) [](https://codecov.io/gh/egoist/minimost)
[](https://github.com/egoist/donate)## Features
- Flags in kebab-case are converted to camelCase, eg: `--foo-bar foo` results in `{ fooBar: 'foo' }`
- Preserve arguments after `--`, eg: `-- npm test` results in `{ '--': ['npm', 'test'] }`
- Separate flags and input, eg: `./bin foo -w` results in `{ input: ['foo'], flags: { w: true } }`## Why not use meow?
This is similar to [meow](https://github.com/substack/minimist), but I sometime just want to parse argv without being a real CLI app.
## Install
```bash
yarn add minimost
```## Usage
```js
const minimost = require('minimost')minimost(process.argv.slice(2), options)
```## API
### minimost(argv, options)
#### options
[minimist](https://github.com/substack/minimist) options, `options['--']` is `true` by default here.
## Contributing
1. Fork it!
2. Create your feature branch: `git checkout -b my-new-feature`
3. Commit your changes: `git commit -am 'Add some feature'`
4. Push to the branch: `git push origin my-new-feature`
5. Submit a pull request :D## Author
**minimost** © [egoist](https://github.com/egoist), Released under the [MIT](./LICENSE) License.
Authored and maintained by egoist with help from contributors ([list](https://github.com/egoist/minimost/contributors)).> [egoist.sh](https://egoist.sh) · GitHub [@egoist](https://github.com/egoist) · Twitter [@_egoistlily](https://twitter.com/_egoistlily)