Skip to content

Pkcarreno/jsod

Repository files navigation

JSOD

Important

The project is under development, so bugs or missing important features are expected.

Write, run, and share JavaScript code instantly.

It's:

  • Open Source
  • Run 100% on your device
  • Powered by QuickJS (via quickjs-emscripten)
  • Shareable
  • Installable
  • Offline first

Caution

Although JSOD aims to provide a safe environment, there may be inappropriate or malicious behavior when executing third-party code.

Motivation

I wanted to have a tool where I could create and run JS code with no extra friction, no text editors, no login screens, no opening the browser console. Plus, I wanted my code to not run on an external server and to be able to share my creations with others privately.

JSOD is a super flexible calculator if you already know JS. You can do data manipulation without having to start your development environment, great for testing logic as you create. Or you can even create a calculator tailored to your needs and share it with your friends or embed it in your web page as a demo.

Limitations

For JavaScript execution, QuickJS-NG is used via quickjs-emscripten. QuickJS-NG aims to be compatible with the latest ECMAScript specifications (for reference, here you can see the progress of these features).

As for the APIs provided by the environment (browser/Node.js) they depend on the implementation of quickjs-emscripten in the project and is currently work in progress. Below is the list of priority APIs to be integrated:

  • fetch
  • timeout
  • interval

Note: You can open an issue and suggest any other API you consider necessary.

Folder Structure

Follow Bulletproof-react project structure.

Development

To get a local copy of the code, clone it using git:

git clone https://github.com/Pkcarreno/jsod
cd jsod

Install dependencies:

 pnpm i

Now, you can start a local web server by running:

pnpm dev

And then open http://localhost:4000 to view it in the browser.

Thanks to

License

This project is licensed under the terms of the MIT license.