https://github.com/metafizzy/transfob
get a transform stream, like through2.obj()
https://github.com/metafizzy/transfob
Last synced: about 1 year ago
JSON representation
get a transform stream, like through2.obj()
- Host: GitHub
- URL: https://github.com/metafizzy/transfob
- Owner: metafizzy
- Created: 2016-11-02T13:03:40.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2016-11-02T13:12:04.000Z (over 9 years ago)
- Last Synced: 2025-03-29T17:01:27.986Z (about 1 year ago)
- Language: JavaScript
- Size: 1000 Bytes
- Stars: 3
- Watchers: 3
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# transfob
Get a transform stream, like `through2.obj()`. Useful for gulp tasks where you want to iterate over files.
``` js
var transfob = require('transfob');
// convert files to JS object
var data = {};
gulp.task( 'data', function() {
return gulp.src('data/*.md')
.pipe( transfob( function( file, enc, next ) {
var basename = path.basename( file.path, path.extname( file.path ) );
data[ file.path ] = file.contents.toString();
next( null, file );
}) );
});
```