npm.io
1.1.4 • Published 4 years ago

@ice/sandbox

Licence
MIT
Version
1.1.4
Deps
0
Size
14 kB
Vulns
0
Weekly
0
Stars
2.1K

@ice/sandbox

icestark sandbox solution. icestark docs.

NPM version Package Quality build status Test coverage NPM downloads David deps

Installation

$ npm install @ice/sandbox --save

Usage

import Sandbox from '@ice/sandbox';

const sandbox = new Sandbox();

// execute scripts in sandbox
sandbox.execScriptInSandbox('window.a = 1;console.log(window.a);');

// clear side effects added by sandbox, such as addEventListener, setInterval
sandbox.clear();

Inspiration

@ice/sandbox is inspired by tc39/proposal-realms, realms-shim and qiankun sandbox.

Contributors

Feel free to report any questions as an issue, we'd love to have your helping hand on icestark.

If you're interested in icestark, see CONTRIBUTING.md for more information to learn how to get started.

License

MIT

Keywords