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

callback-sandbox

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

callback-sandbox

a function wrapper to avoid exception pop to top

latest
Source
npmnpm
Version
0.0.1
Version published
Maintainers
1
Created
Source

callback-sandbox

build status coverage A function wrapper to avoid exception pop to top, or callback when timeout

Installation

$ npm install callback-sandbox

Example

var sandbox = createSandbox(function onError(err){
  //Handle error
  console.log(err);//something wrong
}, 2000/*timeout*/);

setTimeout(sandbox(function(err){
  throw new Error("something wrong");
}, 1000);

API

createSandbox([onError][timeout])

  • onError Call whem an unhandle exception occur in sandbox
  • timeout Default timeout of sandbox

Create a sandbox.

sandbox(fn, [timeout])

  • fn Function to run in the sandbox
  • timeout Timeout for this run. Run function in sandbox and start timeout.

Keywords

sandbox

FAQs

Package last updated on 28 Oct 2016

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