GoogleChromeLabs / jsvu
- пятница, 8 декабря 2017 г. в 03:17:38
JavaScript (engine) Version Updater
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.
Install the jsvu CLI:
npm install jsvu -g
Modify your dotfiles (e.g. ~/.bashrc
) to add ~/.jsvu
to your PATH
:
export PATH="${HOME}/.jsvu:${PATH}"
Then, run jsvu
:
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 |
|||||
SpiderMonkey | spidermonkey or sm |
|||||
V8 | v8 |
* 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:
npm install -g eshost-cli
Then, tell eshost-cli where jsvu installs each JavaScript engine:
eshost --add 'Chakra' ch ~/.jsvu/chakra
eshost --add 'JavaScriptCore' jsc ~/.jsvu/javascriptcore
eshost --add 'SpiderMonkey' jsshell ~/.jsvu/spidermonkey
eshost --add 'V8 --harmony' d8 ~/.jsvu/v8 --args '--harmony'
eshost --add 'V8' d8 ~/.jsvu/v8
That’s it! You can now run code snippets in all those engines with a single command:
eshost -e 'new RegExp("\n").toString()' # https://crbug.com/v8/1982
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. As an additional layer of security, jsvu performs SHA-256 checksum verification where applicable.