Public
Script
Readme

acorn

Acorn is a JavaScript parser written in JavaScript! It's one of the most established, and best, options - written by the same main contributor as CodeMirror and ProseMirror. At Val Town, we use Acorn internally, as well as CodeMirror for the code editor.

With Acorn, you can parse JavaScript, modify it, and generate strings from that parsed JavaScript. It's a lot more robust and productive than processing source code as strings.

1
2
3
4
export let acornExample = (async () => {
const acorn = await import("npm:acorn");
return acorn.parse("1 + 1");
})();
Val Town is a social website to write and deploy JavaScript.
Build APIs and schedule functions from your browser.
Comments
Nobody has commented on this val yet: be the first!
October 23, 2023