JSPM

convert-vinyl-to-vfile

3.0.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 90
  • Score
    100M100P100Q82641F
  • License MIT

Convert a Vinyl file to a VFile

Package Exports

  • convert-vinyl-to-vfile

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (convert-vinyl-to-vfile) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

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