https://github.com/wpj/cerealize
Serialize CLI arguments
https://github.com/wpj/cerealize
Last synced: 8 months ago
JSON representation
Serialize CLI arguments
- Host: GitHub
- URL: https://github.com/wpj/cerealize
- Owner: wpj
- License: mit
- Created: 2017-10-04T03:56:40.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2018-04-29T16:10:17.000Z (about 8 years ago)
- Last Synced: 2025-10-12T14:09:20.841Z (8 months ago)
- Language: JavaScript
- Size: 51.8 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# cerealize
Serialize CLI arguments.
## Install
npm:
```sh
$ npm install --save cerealize
```
yarn:
```sh
$ yarn add cerealize
```
## Usage
```javascript
import toString from 'cerealize';
import { dashes, eq } from 'cerealize/flags';
console.log(toString(dashes, { format: 'markdown' }, './file.js'));
// '--format markdown ./file.js'
console.log(
toString({ format: eq, c: dash }, { format: 'markdown', c: 1 }, './file.js'),
);
// '--format=markdown -c 1 ./file.js'
```