Acorn.js Client Side

How do I run acorn.js clientside?

acorn/dist/acorn.js is a UMD module, so pretty much the same way you’d run any script. For example…

<script src="path/to/acorn/dist/acorn.js"></script>
<script>console.log(acorn.parse("1 + 1", {ecmaVersion: 2020}))</script>

Can this be done in an EJS file in an Express, Node.js app? I seem to be having difficulties doing the above in my EJS file. Thanks.

I’m not familiar with Express, so I can’t really say.