Home

Awesome

evalify

browserify transform to eval modules before exporting.

npm i --save evalify

stolen from mmckegg/web-audio-school.

example

given a module:

// cats.js
var catNames = require('cat-names')

var cats = []
for (var i = 0; i < 10; i++) {
  cats.push(catNames.random())
}

module.exports = cats

compile using browserify using -t [ evalify -f '**/cats.js' ]

browserify ./cats.js -t [ evalify -f '**/cats.js' ]

cats.js file is transformed to

module.exports = ["Cali","Rascal","Jack","Jasmine","Kitty","Nala","Jack","Cookie","Jack","Buster"]

usage

evalify is a browserify transform with the following options:

using the browserify cli:

browserify entry.js -t [ evalify -f '**/to-eval.js' ]

using your package.json:

"browserify": {
  "transform": [
    ["evalify", { files: [ "**/to-eval.js" ] } ]
  ]
}

license

ISC