vinyl-require
v0.0.3
Published
Like calling node's require but instead parses the contents of a vinyl file
Downloads
6
Readme
vinyl-require
Like calling node's
require
but instead parses the contents of a vinyl file
Usage
var vinylRequire = require('vinyl-require');
var aFile = new File({
cwd: "/",
base: "/test/",
path: "/test/file.js",
contents: new Buffer("module.exports = { test: 'yo' }")
});
var resolvedFile = vinylRequire(aFile);
console.log(resolvedFile.test) // yo