sandboxie.js - simple JavaScript sanboxing
This library prevents the code accessing global variables and arguments.
Install
Bower
bower install sandboxie
npm
npm install sandboxie
Example
sandboxie-node.js
var sandboxie = ; { ; return process&&processtitle;}var args = msg : 'The answer' { consolelog; }; var fn1 = ;var fn2 = ; // only alert and msg variables are accesibleconsole;// {} undefined {} 'The answer'// undefined // same as above + function context is argsconsole;// { msg: 'The answer', alert: [Function] } undefined {} 'The answer'// undefined // fn2 has access to process global variableconsole;// {} undefined {} 'The answer'// node
Please note, sandboxie does not prevent infinite loops etc.
Development
git clone
npm install
# edit
npm test