Skip to content
browserify transform to eval modules in node before exporting
Branch: master
Clone or download
Pull request Compare This branch is even with ahdinosaur:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
test
.gitignore
README.md
index.js
package.json

README.md

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:

  • files (f): a list of minimatch paths to determine whether to evaluate a given file.

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

You can’t perform that action at this time.