2016-08-16 06:40:54 +00:00
|
|
|
# smartstream
|
|
|
|
simplifies access to node streams, TypeScript ready!
|
|
|
|
|
2016-09-25 14:10:06 +00:00
|
|
|
## Availabililty
|
|
|
|
[![npm](https://push.rocks/assets/repo-button-npm.svg)](https://www.npmjs.com/package/smartstream)
|
|
|
|
[![git](https://push.rocks/assets/repo-button-git.svg)](https://gitlab.com/pushrocks/smartstream)
|
|
|
|
[![git](https://push.rocks/assets/repo-button-mirror.svg)](https://github.com/pushrocks/smartstream)
|
|
|
|
[![docs](https://push.rocks/assets/repo-button-docs.svg)](https://pushrocks.gitlab.io/smartstream/gitbook)
|
|
|
|
|
|
|
|
## Status for master
|
2016-08-16 06:40:54 +00:00
|
|
|
[![build status](https://gitlab.com/pushrocks/smartstream/badges/master/build.svg)](https://gitlab.com/pushrocks/smartstream/commits/master)
|
2016-09-25 14:10:06 +00:00
|
|
|
[![coverage report](https://gitlab.com/pushrocks/smartstream/badges/master/coverage.svg)](https://gitlab.com/pushrocks/smartstream/commits/master)
|
|
|
|
[![Dependency Status](https://david-dm.org/pushrocks/smartstream.svg)](https://david-dm.org/pushrocks/smartstream)
|
|
|
|
[![bitHound Dependencies](https://www.bithound.io/github/pushrocks/smartstream/badges/dependencies.svg)](https://www.bithound.io/github/pushrocks/smartstream/master/dependencies/npm)
|
|
|
|
[![bitHound Code](https://www.bithound.io/github/pushrocks/smartstream/badges/code.svg)](https://www.bithound.io/github/pushrocks/smartstream)
|
|
|
|
[![TypeScript](https://img.shields.io/badge/TypeScript-2.x-blue.svg)](https://nodejs.org/dist/latest-v6.x/docs/api/)
|
|
|
|
[![node](https://img.shields.io/badge/node->=%206.x.x-blue.svg)](https://nodejs.org/dist/latest-v6.x/docs/api/)
|
|
|
|
[![JavaScript Style Guide](https://img.shields.io/badge/code%20style-standard-brightgreen.svg)](http://standardjs.com/)
|
2016-08-16 06:40:54 +00:00
|
|
|
|
|
|
|
## Usage
|
|
|
|
We recommend the use of TypeScript for best in class intellisense support.
|
|
|
|
|
2016-09-25 14:10:06 +00:00
|
|
|
```typescript
|
|
|
|
import { Smartstream } from 'smartstream'
|
|
|
|
import * as gUglify from 'gulp-uglify'
|
|
|
|
|
|
|
|
let mySmartstream = new Smartstream([
|
|
|
|
gulp.src(['./file1.js','./file2.js']),
|
|
|
|
gUglify(),
|
|
|
|
gulp.dest('./some/output/path')
|
|
|
|
])
|
|
|
|
|
2016-09-25 14:28:42 +00:00
|
|
|
mySmartstream.onError((err) => { /* handle error */ }) // handles all errors in stream
|
|
|
|
myStream.onCustomEvent('myeventname', (args...) => { /* Do something */ }) // emit an custom event anywhere in your stream
|
2016-09-25 14:10:06 +00:00
|
|
|
mySmartstream.run().then(() => {/* do something when stream is finished */})
|
|
|
|
```
|
|
|
|
|