Skip to content
A nifty javascript sandbox for node.js
JavaScript
Find file
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
example
lib
spec
vendor
.gitmodules
README.md

README.md

Node Sandbox

A rudimentary javascript sandbox for use with node.js.

Some features

  • Can be used to execute untrusted code.
  • Support for timeouts (e.g. prevent infinite loops)
  • Handles errors gracefully
  • Restricted code (cannot access NodeJS methods)

Example

Be sure to check out example/example.js

var s = new Sandbox();
s.run('1 + 1 + " apples"', function(output) {
  // output == "2 apples"
});

Issues

There seems to be a race condition somewhere which sometimes prevents output from being returned properly. Update:* This is a node.js issue and will be fixed soon.

Documentation

Coming soon!

Basic syntax: sandbox_instance.run(code_string, hollaback_function)

Author

Written by Gianni Chiappettagf3.ca

Something went wrong with that request. Please try again.