Skip to content
Create a vinyl file or stream from a buffer
JavaScript
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.editorconfig
.gitattributes
.gitignore
.npmrc
.travis.yml
index.js
license
package.json
readme.md
test.js

readme.md

buffer-to-vinyl Build Status

Create a vinyl file or stream from a buffer

Install

$ npm install buffer-to-vinyl

Usage

const fs = require('fs');
const bufferToVinyl = require('buffer-to-vinyl');

bufferToVinyl.file(fs.readFileSync('foo.jpg', null));
bufferToVinyl.stream(fs.readFileSync('foo.jpg', null));

API

bufferToVinyl.file(buffer, [name])

Returns a Vinyl file.

buffer

Type: Buffer

Buffer to create the file from.

name

Type: string

Optional file name.

bufferToVinyl.stream(buffer, [name])

Returns a object PassThrough stream.

buffer

Type: Buffer

Buffer to create the stream from.

name

Type: string

Optional file name.

License

MIT © Kevin Mårtensson

You can’t perform that action at this time.