Need private packages and team management tools?Check out npm Teams »

vinyl-require

0.0.3 • Public • Published

vinyl-require NPM version Build Status

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

MIT © Chris Montgomery

Keywords

Install

npm i vinyl-require

DownloadsWeekly Downloads

2

Version

0.0.3

License

MIT

Last publish

Collaborators

  • avatar