JavaScript
LiveCodes runs JavaScript (JS) in the browser. Accordingly, it has access to the DOM and other Web APIs, but it does not have access to Node.js APIs such as the file system or process information.
Demo
Usage
The JavaScript code is added as-is without any transformations to the result page inside a <script> tag.
If the code has imports or exports, the <script> tag will have type="module" attribute.
The only case where the code is modified is when CommonJS requires are used to import external dependencies (not recommended - use ESM imports instead).
These requires are converted to ESM imports with some glue code to make them work.
Example:
External Modules
Modules can be imported from various sources (e.g. npm, deno.land/x, jsr, CDNs, GitHub, etc.) including bare module imports. The modules are loaded from CDNs using importmaps (see module resolution for details).
Example:
Language Info
Name
javascript
Alias
js
Extensions
js, mjs
Editor
script
Compiler
JavaScript runs natively in the browser without compilation.
Code Formatting
Using Prettier.
Starter Template
https://livecodes.io/?template=Javascript