Show HN: Minimal, modern embedded V8 for Python
github.com
github.com
Use cases are many. For instance, Rails uses ExecJS to minify assets, to compile JavaScript assets from ES6 to older JS runtimes using Babel, for compiling CoffeeScript... In another world - and that's Sqreen use case for this, JavaScript is the 2016 alternative to Lua.
Furthermore, PyMiniRacer is a lightweight alternative to NodeJS if you are a pythonist and need to run JavaScript, for production or for hacking :)
Link to V8: [jeroenooms/V8: Embedded JavaScript Engine for R](https://github.com/jeroenooms/V8)
I use this sometimes because I am so comfortable with nodejs libraries like Moment that I get lazy to figure out things using R.
Is there an example I can copy to imitate this approach?
1. the C# example from React doc, https://facebook.github.io/react/docs/environments.html
2. The BabelJS example from PyMiniRacer: https://github.com/sqreen/PyMiniRacer/blob/master/helpers/ba...
I would be glad to hear more about that :)
https://github.com/sqreen/PyMiniRacer/blob/master/helpers/ba...
You can easily try it once PyMiniRacer is installed to transpile JavaScript files:
cat some-file.js | python helpers/babel.py