Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

browser-module-sandbox

Package Overview
Dependencies
Maintainers
1
Versions
30
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

browser-module-sandbox

uses browserify-cdn to run node code in an iframe

  • 1.3.5
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
21
increased by162.5%
Maintainers
1
Weekly downloads
 
Created
Source

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 = require('browser-module-sandbox')

initialize

sandbox(options)

var sandbox = sandbox({
  cdn: 'http://localhost:8000', // browserify-cdn API endpoint, defaults to the current browser domain root,
  container: dom element where the iframe should be appended,
  iframeHead: string that gets prepended to the `<head>` of the output iframe,
  iframeBody: string that gets prepended to the `<body>` of the output iframe,
  iframeStyle: string for css, gets appended to end of iframeHead,
  iframe: iframe instance, default creates a new one inside container
})

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('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

FAQs

Package last updated on 11 Mar 2014

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc