ghost-sandbox

Sandbox for Node.js modules

Showing:

Popularity

Downloads/wk

5

GitHub Stars

0

Maintenance

Last Commit

5yrs ago

Contributors

0

Package

Dependencies

0

Size (min+gzip)

0.7KB

License

MIT

Type Definitions

Tree-Shakeable

No?

Categories

Readme

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.

License

(MIT License)

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100