convert-vinyl-to-vfile

3.0.0 • Public • Published

convert-vinyl-to-vfile

NPM version Build Status Coverage Status

Code Climate Dependencies DevDependencies

Convert a Vinyl file to a VFile

Install

npm install --save convert-vinyl-to-vfile

Usage

const convertVinylToVfile = require('convert-vinyl-to-vfile')
const {join} = require('path');
const VFile = require('vfile');
const Vinyl = require('vinyl');
 
const vinylFile = new Vinyl({
  contents: Buffer.from('abe lincoln'),
  path: join('users', 'dustin', 'project', 'awesome.project.md')
});
 
const vfile = convertVinylToVfile(vinylFile);
/* =>
 * new VFile({
 *   contents: <Buffer 61 62 65 20 6c 69 6e 63 6f 6c 6e>,
 *   path: 'users/dustin/project/awesome.project.md'
 * })
 */
 
vfile instanceof VFile;
// => true

LICENSE

MIT © Dustin Specker

Readme

Keywords

Package Sidebar

Install

npm i convert-vinyl-to-vfile

Weekly Downloads

24

Version

3.0.0

License

MIT

Unpacked Size

4.58 kB

Total Files

4

Last publish

Collaborators

  • dustinspecker
  • wooorm