Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/junosuarez/node-gulp-trailer
node module: a file to a source stream after all others are done
https://github.com/junosuarez/node-gulp-trailer
Last synced: 8 days ago
JSON representation
node module: a file to a source stream after all others are done
- Host: GitHub
- URL: https://github.com/junosuarez/node-gulp-trailer
- Owner: junosuarez
- License: isc
- Created: 2014-05-31T08:11:05.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2014-05-31T08:13:40.000Z (over 10 years ago)
- Last Synced: 2024-11-02T06:31:55.584Z (13 days ago)
- Language: JavaScript
- Size: 125 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# gulp-trailer
add a file to a source stream after all others are done## usage
```js
var gulpTrailer = require('gulp-trailer')
var gulp = require('gulp')var files = []
gulp.src('./**/*.js')
.on('data', function (x) {
files.push(x.path)
})
.pipe(trailer('./manifest.json', function (cb) {
cb(null, JSON.stringify(files))
}))
.pipe(gulp.dest('./dest'))
```
this example keeps a list of all files written and then creates a `manifest.json` file with an array of all their paths## api
### `trailer(filename: String, endFn : Function) => VinylThroughStream`
call `trailer` with a `filename` for the new file you want to add and an asynchronous `endFn` which will be used to return the contents of the file.
Your `endFn` should call its callback with a `String`, a `Buffer` or a `Stream`.
## installation
$ npm install gulp-trailer
## running the tests
From package root:
$ npm install
$ npm test## contributors
- jden
## license
ISC. (c) MMXIV jden . See LICENSE.md