Store virtual file format as regular object
npm install --save vinyl-to-object
var File = require('vinyl');
var copy = require('vinyl-to-object');
var file = new File({
cwd: 'test',
base: 'test',
path: '/test/test.txt',
contents: new Buffer('unicorn')
});
var duplicatedFile = copy(file);
Type: vinyl file
Vinyl file to convert
MIT © Daniel Husar