0.0.7 • Published 8 years ago
commonjs-editor v0.0.7
commonjs-editor
Edit and execute top-level files of CommonJS modules in browsers. Usage here, live demo here. CommonjsEditor is powered by browserify and c9.ace.io. Node-inspired variables accessible inside the editor:
global: the global object.require: for importing CommonJS modules.module: for redefining the entire export.exports: for exporting a particular field.__filename: relative tooptions.basedir.__dirname: relative tooptions.basedir.process: if defined:process.argv[1] = __filename.Buffer: only available whenBufferorrequire("buffer")is present.
Playground
playground.path :: string
playground :: commonjs-editor.Playground
playground.modules :: [string]
playground :: commonjs-editor.Playground
playground.initial :: string
playground :: commonjs-editor.Playground
playground.require :: string
playground :: commonjs-editor.Playground
require("commonjs-editor/playground")(path, options, callback)
path :: stringoptions :: browserify.Optionscallback(error, playground)error :: Errorplayground :: commonjs-editor.Playground
editor = require("commonjs-editor")(container, playground)
container :: dom.Elementplayground :: commonjs-editor.Playgroundeditor :: c9.ace.io.Editorbundle = getBundle()