Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dustinspecker/convert-vinyl-to-vfile
Convert a Vinyl file to a VFile
https://github.com/dustinspecker/convert-vinyl-to-vfile
Last synced: 2 days ago
JSON representation
Convert a Vinyl file to a VFile
- Host: GitHub
- URL: https://github.com/dustinspecker/convert-vinyl-to-vfile
- Owner: dustinspecker
- License: mit
- Created: 2015-09-06T23:05:50.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2020-06-16T02:10:56.000Z (over 4 years ago)
- Last Synced: 2024-04-25T10:21:30.045Z (7 months ago)
- Language: JavaScript
- Size: 32.2 KB
- Stars: 6
- Watchers: 4
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# convert-vinyl-to-vfile
[![NPM version](https://badge.fury.io/js/convert-vinyl-to-vfile.svg)](https://badge.fury.io/js/convert-vinyl-to-vfile) [![Build Status](https://travis-ci.org/dustinspecker/convert-vinyl-to-vfile.svg)](https://travis-ci.org/dustinspecker/convert-vinyl-to-vfile) [![Coverage Status](https://img.shields.io/coveralls/dustinspecker/convert-vinyl-to-vfile.svg)](https://coveralls.io/r/dustinspecker/convert-vinyl-to-vfile?branch=master)[![Code Climate](https://codeclimate.com/github/dustinspecker/convert-vinyl-to-vfile/badges/gpa.svg)](https://codeclimate.com/github/dustinspecker/convert-vinyl-to-vfile) [![Dependencies](https://david-dm.org/dustinspecker/convert-vinyl-to-vfile.svg)](https://david-dm.org/dustinspecker/convert-vinyl-to-vfile) [![DevDependencies](https://david-dm.org/dustinspecker/convert-vinyl-to-vfile/dev-status.svg)](https://david-dm.org/dustinspecker/convert-vinyl-to-vfile?type=dev)
> Convert a [Vinyl](https://github.com/wearefractal/vinyl) file to a [VFile](https://github.com/vfile/vfile)
## Install
```
npm install --save convert-vinyl-to-vfile
```## Usage
```javascript
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: ,
* path: 'users/dustin/project/awesome.project.md'
* })
*/vfile instanceof VFile;
// => true
```## LICENSE
MIT © [Dustin Specker](https://github.com/dustinspecker)