Skip to content

kevva/buffer-to-vinyl

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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

About

Create a vinyl file or stream from a buffer

Resources

License

Stars

Watchers

Forks

Packages

No packages published