Name: jsvu
Owner: GoogleChromeLabs
Description: JavaScript (engine) Version Updater
Created: 2017-11-29 19:53:47.0
Updated: 2018-05-22 22:45:12.0
Pushed: 2018-05-12 23:39:33.0
Homepage: https://mths.be/jsvu
Size: 86
Language: JavaScript
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
jsvu is the JavaScript (engine) Version Updater.
jsvu makes it easy to install recent versions of various JavaScript engines without having to compile them from source.
Note: jsvu requires Node.js v8.9.0+. (jsvu follows the latest active LTS version of Node.)
Install the jsvu CLI:
install jsvu -g
Modify your dotfiles (e.g. ~/.bashrc
) to add ~/.jsvu
to your PATH
:
rt PATH="${HOME}/.jsvu:${PATH}"
Then, run jsvu
:
On first run, jsvu
prompts you for your operating system and architecture, and the list of JavaScript engines you wish to manage through jsvu
. It then downloads and installs the latest version of each of the engines you selected.
To update the installed JavaScript engines later on, just run jsvu
again.
| JavaScript engine | Binary name | mac64
| win32
| win64
| linux32
| linux64
|
| ————————- | ————————- | ——————- | ————— | ——————– | ——— | ——— |
| Chakra | chakra
or ch
| ? | ? | ? | ? | ? |
| JavaScriptCore | javascriptcore
or jsc
| ? | ? * | ? (32)* | ? | ? |
| SpiderMonkey | spidermonkey
or sm
| ? | ? | ? | ? | ? |
| V8 | v8
| ? | ? | ? | ? | ? |
| XS | xs
| ? (32) | ? | ? (32) | ? | ? |
* To get JavaScriptCore running on Windows, you?ll have to install iTunes.
eshost-cli makes it easy to run and compare code in all JavaScript engines that jsvu installs.
First, install eshost-cli:
install -g eshost-cli
Then, tell eshost-cli where jsvu installs each JavaScript engine.
st --add 'Chakra' ch ~/.jsvu/chakra
st --add 'JavaScriptCore' jsc ~/.jsvu/javascriptcore
st --add 'SpiderMonkey' jsshell ~/.jsvu/spidermonkey
st --add 'V8 --harmony' d8 ~/.jsvu/v8 --args '--harmony'
st --add 'V8' d8 ~/.jsvu/v8
st --add 'XS' xs ~/.jsvu/xs
st --add "Chakra" ch "%USERPROFILE%\.jsvu\chakra.cmd"
st --add "JavaScriptCore" jsc "%USERPROFILE%\.jsvu\javascriptcore.cmd"
st --add "SpiderMonkey" jsshell "%USERPROFILE%\.jsvu\spidermonkey.cmd"
st --add "V8 --harmony" d8 "%USERPROFILE%\.jsvu\v8.cmd" --args "--harmony"
st --add "V8" d8 "%USERPROFILE%\.jsvu\v8.cmd"
st --add "XS" xs "%USERPROFILE%\.jsvu\xs.cmd"
That?s it! You can now run code snippets in all those engines with a single command:
st -e 'new RegExp("\n").toString()' # https://crbug.com/v8/1982
st -e '(function maxCallStackSize() { try { return 1 + maxCallStackSize(); } catch (_) { return 1; }}())'
On your personal devices, the only command you?ll ever need is jsvu
as described above. There are no command-line flags to remember. ??
However, there are use cases for running jsvu within non-interactive environments (e.g. as part of continuous integration), where it?s desirable to bypass the initial jsvu
prompt asking to confirm your operating system, architecture, and the list of JavaScript engines to install. Here?s how to do that:
--os=mac64 --engines=all
uivalent to:
--os=mac64 --engines=chakra,javascriptcore,spidermonkey,v8,xs
jsvu avoids the need for sudo
privileges by installing everything in ~/.jsvu
rather than, say, /usr/bin
.
jsvu downloads files over HTTPS, and only uses URLs that are controlled by the creators of the JavaScript engine or, in the case of JavaScriptCore on Linux, the port maintainers. As an additional layer of security, jsvu performs SHA-256 checksum verification where applicable.