https://github.com/hughsk/vinyl-buffer
Convert streaming vinyl files to use buffers
https://github.com/hughsk/vinyl-buffer
Last synced: 2 months ago
JSON representation
Convert streaming vinyl files to use buffers
- Host: GitHub
- URL: https://github.com/hughsk/vinyl-buffer
- Owner: hughsk
- License: mit
- Created: 2014-02-23T03:40:39.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2020-09-02T15:27:22.000Z (almost 5 years ago)
- Last Synced: 2024-04-13T22:53:42.793Z (about 1 year ago)
- Language: JavaScript
- Size: 5.86 KB
- Stars: 76
- Watchers: 4
- Forks: 10
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# vinyl-buffer [](https://flattr.com/submit/auto?user_id=hughskennedy&url=http://github.com/hughsk/vinyl-buffer&title=vinyl-buffer&description=hughsk/vinyl-buffer%20on%20GitHub&language=en_GB&tags=flattr,github,javascript&category=software)[](http://github.com/hughsk/stability-badges) #
Convert streaming [vinyl](http://github.com/wearefractal/vinyl) files to use
buffers.An alternative to [gulp-streamify](http://github.com/nfroidure/gulp-streamify)
that you can pipe to, instead of being required to wrap your streams.``` javascript
var browserify = require('browserify')
var source = require('vinyl-source-stream')
var buffer = require('vinyl-buffer')
var uglify = require('gulp-uglify')
var size = require('gulp-size')
var gulp = require('gulp')gulp.task('build', function() {
var bundler = browserify('./index.js')return bundler.bundle()
.pipe(source('index.js'))
.pipe(buffer())
.pipe(uglify())
.pipe(size())
.pipe(gulp.dest('dist/'))
})
```## Usage ##
[](https://nodei.co/npm/vinyl-buffer)
### `vinylBuffer()` ###
Creates a transform stream that takes vinyl files as input, and outputs
modified vinyl files as output. If `file.isStream()`, `file.contents` will
be converted to a `Buffer` before being emitted again – otherwise, the file
will be emitted immediately.## License ##
MIT. See [LICENSE.md](http://github.com/hughsk/vinyl-buffer/blob/master/LICENSE.md) for details.