browser-module-sandbox
uses browserify-cdn to run node code in an iframe
requires a hosted browserify-cdn
npm install browser-module-sandbox
usage
var Sandbox =
initialize
sandbox(options)
var sandbox =
bundling
sandbox.bundle(entry, preferredVersions)
sandbox.bundle('console.log(require("underscore"))', {'underscore': '1.3.3'})
preferredVersions
is optional, version will otherwise default to latest
events
sandbox.on('modules', function(modules) {})
modules is the array of modules that gets parsed out of the bundle entry by the detective
module
sandbox.on('bundleStart', function() {})
emits when the bundle request begins
sandbox.on('bundleContent', function(body) {})
emits when the iframe content is being built, body
is a string made up of all the bundles (NOTE: it doesn't contain entry
)
sandbox.on('bundleEnd', function(html) {})
emits when the bundle request finishes. html
is an object that has the iframe header contents and the full bundle body (made of up all the bundles + the entry in an executable form)
license
BSD