commander-rxjs
Advanced tools
Comparing version 0.0.3 to 0.0.4
{ | ||
"name": "commander-rxjs", | ||
"version": "0.0.3", | ||
"version": "0.0.4", | ||
"description": "A simple adapter to easily use RxJS with commander.", | ||
@@ -9,2 +9,18 @@ "main": "dist/index.js", | ||
"license": "MIT", | ||
"engines": { | ||
"node": ">=4.0.0" | ||
}, | ||
"files": [ | ||
"dist" | ||
], | ||
"scripts": { | ||
"prebuild": "rimraf dist", | ||
"build": "babel src -d dist --ignore spec.js", | ||
"coverage": "jest --coverage", | ||
"postcoverage": "opn coverage/lcov-report/index.html", | ||
"example:calculator": "babel-node examples/calculator", | ||
"example:json-fetch": "babel-node examples/json-fetch", | ||
"prepublish": "npm run build", | ||
"test": "jest" | ||
}, | ||
"dependencies": { | ||
@@ -24,4 +40,6 @@ "camel-case": "^3.0.0" | ||
"node-fetch": "^1.6.3", | ||
"opn-cli": "^3.1.0", | ||
"rimraf": "^2.5.4", | ||
"rxjs": "^5.0.0-rc.4" | ||
"rxjs": "^5.0.0-rc.4", | ||
"serve": "^1.4.0" | ||
}, | ||
@@ -31,11 +49,3 @@ "peerDependencies": { | ||
"rxjs": "~5.0.0 || ^5.0.0-rc.1" | ||
}, | ||
"scripts": { | ||
"build": "babel src -d dist --ignore spec.js", | ||
"example:calculator": "babel-node examples/calculator", | ||
"example:json-fetch": "babel-node examples/json-fetch", | ||
"prebuild": "rimraf dist", | ||
"prepublish": "npm run build", | ||
"test": "jest" | ||
} | ||
} |
# commander-rxjs | ||
<!-- NPM: --> | ||
<a href="https://www.npmjs.com/package/commander-rxjs"> | ||
<img src="https://img.shields.io/npm/v/commander-rxjs.svg?style=flat"/> | ||
<!-- TravisCI: --> | ||
</a><a href="https://travis-ci.org/nickbreaton/commander-rxjs"> | ||
<img src="https://img.shields.io/travis/nickbreaton/commander-rxjs/master.svg?style=flat"/> | ||
</a> | ||
<!-- npm -->[](https://www.npmjs.com/package/commander-rxjs) | ||
<!-- travisci -->[](https://travis-ci.org/nickbreaton/commander-rxjs) | ||
<!-- codecov --> [](https://codecov.io/gh/nickbreaton/commander-rxjs) | ||
@@ -16,11 +12,17 @@ A simple adapter to easily use [RxJS](https://github.com/ReactiveX/RxJS) with [commander](https://github.com/tj/commander.js). | ||
``` | ||
$ npm install rxjs commander | ||
$ npm install commander-rxjs | ||
``` | ||
**Note:** `commander` and `rxjs` are both specified as peer dependencies. You must install them alongside `commander-rxjs`. | ||
``` | ||
$ npm install commander rxjs | ||
``` | ||
## Convert commands to observables | ||
At anytime in the commander process, an `observe()` function can be chained providing an RxJS observable when the command is executed. | ||
`commander-rxjs` provides a `.observe()` function to convert commands an RxJS observable. | ||
**Note:** The `.observe()` can be used any place commander's `.action(cb)` function can be used. | ||
```js | ||
@@ -27,0 +29,0 @@ import program from 'commander-rxjs'; |
9090
44
14
5