JS-Interpreter icon indicating copy to clipboard operation
JS-Interpreter copied to clipboard

Support Node.js/RequireJS/TypeScript

Open arcatdmz opened this issue 8 years ago • 1 comments

I've been a big fan of this interpreter for several years, and have used this for my research projects such as TextAlive and f3.js - so let me firstly thank you for open-sourcing such a valuable codebase. I forked my own code which has evolved by itself for a while, and yesterday, noticed that the original repo is still growing ... significantly!

So, instead of merging all the recent changes into my own fork, I decided to create a fresh fork that matches my needs and that could benefit more people, hopefully including the original authors of this interpreter.

This fork contains the following changes:

  • Ported to TypeScript ... the main body of the interpreter is ported to TypeScript with more strict type checking. Type definition is available at dist/interpreter.d.ts.
  • Packed with tsc ... the main body of the interpreter is now compiled with the TypeScript compiler tsc with the umd option that produces dist/interpreter.js that can be loaded from a web browser with RequireJS or from a Node.js environment.
  • Packed with webpack ... to statically load the library from a web browser, dist/interpreter.global.js and dist/acorn_interpreter.js are generated with help of Webpack.
  • Some more demo code ... README.md shows basic usage. https://junkato.jp/JS-Interpreter/ shows the demo of running { raw sources, compressed bundle, dynamically loaded library } whose source code can be found at index.html. A very simple Node.js example can also be found at index.ts.

To build the repo, simply type npm install, and then, type either one of npm run build, npm run build-global, or npm run build-with-acorn.

arcatdmz avatar Aug 12 '17 19:08 arcatdmz

this is out of date :(

Kreijstal avatar Mar 24 '24 11:03 Kreijstal