New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

commonjs-editor

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

commonjs-editor

Edit and execute top-level files of CommonJS modules in browsers

latest
Source
npmnpm
Version
0.0.7
Version published
Weekly downloads
3
200%
Maintainers
1
Weekly downloads
 
Created
Source

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 to options.basedir.
  • __dirname: relative to options.basedir.
  • process: if defined: process.argv[1] = __filename.
  • Buffer: only available when Buffer or require("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 :: string
  • options :: browserify.Options
  • callback(error, playground)
    • error :: Error
    • playground :: commonjs-editor.Playground

editor = require("commonjs-editor")(container, playground)

  • container :: dom.Element
  • playground :: commonjs-editor.Playground
  • editor :: c9.ace.io.Editor
    • bundle = getBundle()

Keywords

CommonJS

FAQs

Package last updated on 07 Oct 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts