https://github.com/varharrie/simple_sandbox
Provides a simple sandbox environment to execute javascript code.
https://github.com/varharrie/simple_sandbox
deno sandbox
Last synced: 4 months ago
JSON representation
Provides a simple sandbox environment to execute javascript code.
- Host: GitHub
- URL: https://github.com/varharrie/simple_sandbox
- Owner: varHarrie
- License: mit
- Created: 2022-02-24T08:04:17.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2022-03-15T11:47:03.000Z (over 3 years ago)
- Last Synced: 2025-02-20T16:42:22.003Z (5 months ago)
- Topics: deno, sandbox
- Language: TypeScript
- Homepage: https://deno.land/x/simple_sandbox
- Size: 4.88 KB
- Stars: 3
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# simple_sandbox for Deno
Provides a simple sandbox environment to execute javascript code.
## Usage
```javascript
import { Sandbox } from "https://deno.land/x/simple_sandbox/mod.ts";const code = `
export default function (n, m) {
return n + m;
}
`;const sandbox = new Sandbox();
const result = await sandbox.execute({
code,
args: [2, 3],
timeout: 1500,
});console.log(result); // 5
```