scriptybox is a simple client-side javascript sandbox. It allows you to run untrusted code in a sandboxed environment as a function with very low (<

omduggineni/scriptybox

submited by
Style Pass
2023-05-25 13:00:04

scriptybox is a simple client-side javascript sandbox. It allows you to run untrusted code in a sandboxed environment as a function with very low (<1ms) overhead.

The runInSandbox function takes a string of javascript code and a list of arguments. It returns a promise that resolves to a function that can be called with the arguments passed to runInSandbox. The argument names show up in the sandboxed code as variables, and the return value of the sandboxed code is the return value of the function.

Any JSON object can be passed to the sandboxed code as an argument. The sandboxed code can return any JSON object as a return value.

Leave a Comment
Related Posts