Socket
Socket
Sign inDemoInstall

ghost-sandbox

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ghost-sandbox

Sandbox for loading node modules extracted from Ghost


Version published
Maintainers
1
Created
Source

Ghost Sandbox

This module was extracted from the Ghost blogging platform project. Its sole purpose is to create a sandboxed environment for Node.js modules.

Installation

npm install ghost-sandbox

Example 1: Using a whitelist

Using a whitelist will only allow the the sandboxed module to require the listed modules.

"use strict";

const Sandbox = require('ghost-sandbox');

const sandbox = new Sandbox({
  whitelist: ['when', 'lodash', ...]
});

const sandboxedModule = sandbox.loadWidget(modulePath);

Example 2: Using a blacklist

Using a blacklist will only reject the listed modules.

"use strict";

const Sandbox = require('ghost-sandbox');

const sandbox = new Sandbox({
  blacklist: ['path', 'fs', ...]
});

const sandboxedModule = sandbox.loadWidget(modulePath);

Note: If you include both options, the whitelist will supersede the blacklist.

Test

npm test

Change log

v1.0.1
  • Fixed logical error when loading modules
  • Updated README
v1.0.0
  • Removed lodash as dependency
v0.1.1
  • Updated code to ES6
v0.1.0

First version

License

(MIT License)

Keywords

FAQs

Package last updated on 12 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

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