Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

convert-vinyl-to-vfile

Package Overview
Dependencies
Maintainers
2
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

convert-vinyl-to-vfile

Convert a Vinyl file to a VFile

  • 3.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
46
decreased by-52.08%
Maintainers
2
Weekly downloads
 
Created
Source

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

Keywords

FAQs

Package last updated on 16 Jun 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc