1
0
mirror of https://github.com/onkelbeh/cheatsheets.git synced 2026-08-15 21:44:51 +02:00

Add more stuff.

This commit is contained in:
Rico Sta. Cruz
2014-08-04 09:54:34 +08:00
parent e07b88d02c
commit c03d0b74e3
2 changed files with 24 additions and 2 deletions

24
minimist.md Normal file
View File

@@ -0,0 +1,24 @@
---
title: minimist
layout: default
---
```js
var args = require('minimist')(process.argv.slice(2), {
string: 'lang',
boolean: 'pager',
alias: { h: 'help', v: 'version' }
});
// --lang xml --no-pager -h index.js package.json
args == {
lang: 'xml', pager: false,
h: true, help: true,
_: [ 'index.js', 'package.json' ]
}
```
### Reference
* https://www.npmjs.org/package/minimist
* https://github.com/substack/minimist