Show HN: SafeScript, a safe version of JavaScript for executing untrusted code
SafeScript is a lightweight, restricted subset of JavaScript designed to execute untrusted code safely. By removing dangerous features like globals and prototype access, it allows developers to run scripts in a sandboxed environment.
Why it matters
It offers a secure way to handle dynamic code execution in web and server-side applications, reducing the risk of security vulnerabilities.
JSON for code. A safe computational subset of JavaScript.
JSON gave the world a safe way to exchange data. SafeScript does the same for computation. It's a strict subset of JavaScript — no eval , no new , no globals, no prototype access — that compiles to plain JS and PHP. Open a .safe file and you see code that's safe to run. The compiler is ~48 KB minified (~12 KB gzipped). Ship it anywhere, verify locally, no trust needed.
SafeScript starts small, the same way JSON did. Anywhere you need a safe handler for data or events:
Get smarter about the news
Sign up free for a feed built around what you actually care about, Dive Deeper research on any story, and the full text of every article.
Create free accountAlready have an account? Sign in