This Gist contains sources and instructions for setting up eshost-cli without needing to build anything. (However, some information about where to get sources and how to build is included, if you are so inclined.)
Get eshost-cli
npm install -g eshost-cli
- Run as
eshost
(See also eshost)
- SpiderMonkey:
- Pre-built binaries:
- Download the appropriate package from Mozilla
- Copy all binaries and use
js.exe
as the host: - Add to
eshost
with e.g.eshost --add sm jsshell c:\dev\eshost-bin\sm\js.exe
- Build from source:
- Source code available here: https://developer.mozilla.org/en-US/docs/Mozilla/Projects/SpiderMonkey
- Pre-built binaries:
- V8:
- Builds of D8 are not available, but you can use node.js as a proxy for recent V8:
- Build from source:
- Source code available on GitHub at: https://github.com/v8/v8
- See instructions at https://github.com/v8/v8#getting-the-code to get the source code and all dependencies to build
- Get code or sync/update and compile:
fetch v8
(first time) orgit pull origin; gclient sync
(afterwards)cd v8
if you're not already therepython tools\dev\v8gen.py x64.release
ninja -C out.gn\x64.release
out.gn\x64.release
will contain the binaries, includingd8
- ChakraCore:
- via ChakraCore Releases
- Download
ChakraCore-binaries.zip
for a given release - Extract
ChakraCore.dll
andch.exe
from your chosen architecture - Add to
eshost
with e.g.eshost --add ch-1.4.4 ch c:\dev\eshost-bin\ch-1.4.4\ch.exe
- Download
- via preview NuGet packages on MyGet:
- Download package
- Open in a zip archive viewer of your choice
- Extract
ChakraCore.dll
andch.exe
from e.g.native\v140\x64\release\*
- Add to
eshost
with e.g.eshost --add ch-1.5.0-pre ch c:\dev\eshost-bin\ch-1.5.0-pre\ch.exe
- via Node-ChakraCore from NVS:
- Add to
eshost
with e.g.eshost --add node-ch node %LOCALAPPDATA%\nvs\chakracore\8.0.0-pre3\x64\node.exe
- Add to
- Build from source:
- Source code available on GitHub at: https://github.com/Microsoft/ChakraCore
- Build instructions here: https://github.com/Microsoft/ChakraCore/wiki/Building-ChakraCore
- via ChakraCore Releases
- WebKit:
- Build from source:
- It is possible to build just JSC for Windows
- Source code available on GitHub at: https://github.com/WebKit/webkit/tree/master/Source/JavaScriptCore
- Build from source:
Using the above sources (without building anything) I was able to set up eshost
with (reasonably recent) coverage for SpiderMonkey, V8 (via node), and ChakraCore. (I included a few variants of variously recent ChakraCore.)
┌────────────┬─────────┬───────────────────────────────────────────────────────────────────────┬──────┐
│ name │ type │ path │ args │
├────────────┼─────────┼───────────────────────────────────────────────────────────────────────┼──────┤
│ sm │ jsshell │ E:\dd\eshost-bin\sm\js.exe │ │
├────────────┼─────────┼───────────────────────────────────────────────────────────────────────┼──────┤
│ node │ node │ C:\Users\dilijev\AppData\Local\nvs\node\8.0.0\x64\node.exe │ │
├────────────┼─────────┼───────────────────────────────────────────────────────────────────────┼──────┤
│ node-ch │ node │ C:\Users\dilijev\AppData\Local\nvs\chakracore\8.0.0-pre3\x64\node.exe │ │
├────────────┼─────────┼───────────────────────────────────────────────────────────────────────┼──────┤
│ ch-1.2.3 │ ch │ E:\dd\eshost-bin\ch-1.2.3\ch.exe │ │
├────────────┼─────────┼───────────────────────────────────────────────────────────────────────┼──────┤
│ ch-1.3.2 │ ch │ E:\dd\eshost-bin\ch-1.3.2\ch.exe │ │
├────────────┼─────────┼───────────────────────────────────────────────────────────────────────┼──────┤
│ ch-1.4.4 │ ch │ E:\dd\eshost-bin\ch-1.4.4\ch.exe │ │
├────────────┼─────────┼───────────────────────────────────────────────────────────────────────┼──────┤
│ ch-1.5.0 │ ch │ E:\dd\eshost-bin\ch-1.5.0\ch.exe │ │
└────────────┴─────────┴───────────────────────────────────────────────────────────────────────┴──────┘
> es -ts -e "2"
┌────────────┬───┐
│ sm │ 2 │
│ node │ │
│ node-ch │ │
│ ch-1.2.3 │ │
│ ch-1.3.2 │ │
│ ch-1.4.4 │ │
│ ch-1.5.0 │ │
└────────────┴───┘