Node.js on ChakraCore 🐢🚀
JavaScript C++ Python C HTML Makefile Other
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.github doc: add multiple issue templates for GitHub Aug 12, 2018
benchmark meta: merge node/master into node-chakracore/master Aug 20, 2018
deps chakrashim: fix build break caused by change to v8 method signature Aug 20, 2018
doc meta: merge node/master into node-chakracore/master Aug 20, 2018
lib meta: merge node/master into node-chakracore/master Aug 20, 2018
src meta: merge node/master into node-chakracore/master Aug 20, 2018
test meta: merge node/master into node-chakracore/master Aug 20, 2018
tools meta: merge node/master into node-chakracore/master Aug 20, 2018
.clang-format tools: add `make format-cpp` to run clang-format on C++ diffs Aug 3, 2018
.editorconfig tools: apply editorconfig rules to tools also Apr 1, 2018
.eslintignore tools: delete redundant .eslintignore rule Apr 21, 2018
.eslintrc.js tools: simplify ESLint invocation in Makefile Aug 19, 2018
.gitattributes src: limit .gitattributes eol to vcbuild.bat Jan 13, 2015
.gitignore tools: add `make format-cpp` to run clang-format on C++ diffs Aug 3, 2018
.mailmap doc: update AUTHORS list Jun 25, 2018
.nycrc test: fix tests that fail under coverage May 22, 2018
.remarkrc tools: use remark-preset-lint-node in .remarkrc Oct 25, 2017
.travis.yml build: improve Travis CI settings Jun 26, 2018
AUTHORS doc: update AUTHORS list Jun 25, 2018
BSDmakefile node: rename from io.js to node Aug 23, 2015
BUILDING.md doc: Windows building supported on x64 Aug 16, 2018
CHANGELOG.md 2018-08-15, Version 10.9.0 (Current) Aug 16, 2018
CODE_OF_CONDUCT.md doc: move Code of Conduct to admin repo Nov 28, 2017
COLLABORATOR_GUIDE.md doc: replace deprecated CI job Jul 25, 2018
CONTRIBUTING.md doc: split CONTRIBUTING.md Jan 23, 2018
CPP_STYLE_GUIDE.md doc: add snake_case section for C-like structs May 6, 2018
GOVERNANCE.md doc: add new documentation lint rule Feb 23, 2018
LICENSE inspector: add inspector_protocol as a direct dependency Aug 11, 2018
Makefile meta: merge node/master into node-chakracore/master Aug 20, 2018
README.md doc: Mac OS -> macOS Jun 1, 2018
TTD-README.md lib,src: enable TTD auto-trace config May 22, 2018
android-configure build: don't create directory for NDK toolchain Mar 22, 2017
common.gypi meta: merge node/master into node-chakracore/master Aug 20, 2018
configure meta: merge node/master into node-chakracore/master Aug 13, 2018
node.gyp meta: merge node/master into node-chakracore/master Aug 13, 2018
node.gypi meta: merge node/master into node-chakracore/master Jun 6, 2018
vcbuild.bat meta: merge node/master into node-chakracore/master Aug 6, 2018

README.md

Node.js on ChakraCore

This project enables Node.js to optionally use the ChakraCore JavaScript engine. This project is still work in progress and not an officially supported Node.js branch. For more context into this project, please refer to the original PR.

How it works

To enable building and running Node.js with the ChakraCore JavaScript engine, a V8 API shim (ChakraShim) is created on top of the ChakraCore runtime hosting API (JSRT. ChakraShim implements the most essential V8 APIs so that the underlying JavaScript engine change is transparent to Node.js and other native addon modules written for V8.

A rebuild of node and native addon modules with ChakraCore is required for this to work.

Time Travel Debugging

Time-Travel debugging is an exciting new addition to Node.js debugging, first introduced in Node-ChakraCore, and now supported by VSCode. We are developing in the open and want to share our progress to get feedback, bug reports, functionality requests, and pull-requests from the community.

Check out this Time-Travel Debugging page to learn how to get started with TTD on Node-ChakraCore with VSCode.

Node.js API (NAPI)

Node-ChakraCore is an active participant in the ABI-Stable-Node project also called NAPI. The goal of this project is to ease the lives of native add-ons developers, by providing a stable Node API which also guarantees stable ABI across disparate Node versions. This allows native modules to just work across different versions and flavors of Node.js without recompilations, reducing the maintenance cost for module developers and thus improving compatibility.

Head over to the NAPI Project repo to learn more about it and ways to get involved.

Installing prebuilt Node-ChakraCore binaries

You can download and install stable prebuilt Node-ChakraCore from the releases page.

For installing Node-ChakraCore side-by-side your existing Node installation, we recommend Node Version Switcher (NVS).

$ nvs remote chakracore https://nodejs.org/download/chakracore-release/
$ nvs add chakracore/latest
$ nvs use chakracore

Nightly builds of Node-ChakraCore are available at https://nodejs.org/download/chakracore-nightly/ Please use the following instructions to install the nightly builds.

$ nvs remote chakracore-nightly https://nodejs.org/download/chakracore-nightly/
$ nvs add chakracore-nightly/latest
$ nvs use chakracore-nightly

Building Node-ChakraCore

Node-ChakraCore can be built on Windows, Linux, and macOS.

If you are looking to build this yourself, here's what you will need.

Windows

Prerequisites:

Build Command:

> vcbuild [x86|x64|arm]

To run unit tests

> vcbuild nobuild test ignore-flaky [x86|x64|arm]

To test if Node.js was built correctly with ChakraCore:

> node -e "console.log('Hello from Node.js ' + process.jsEngine)"
Hello from Node.js chakracore

Linux

Install building tools and ChakraCore dependencies: Clang 3.7+ / CMake 3.2 are required

Debian/Ubuntu:

$ sudo apt-get install -y build-essential cmake clang libicu-dev

Fedora:

$ su
$ dnf group install -y "Development Tools" "C Development Tools and Libraries"
$ dnf install -y git cmake clang gcc gcc-c++ kernel-devel python llvm
$ dnf install -y lttng-ust-devel.x86_64 libicu-devel.x86_64 libstdc++-static.x86_64

Clone this repo and check out master branch:

$ git checkout master

Build:

$ ./configure
$ make

To run unit tests:

$ FLAKY_TESTS=dontcare make test

To test if Node.js was built correctly with ChakraCore:

$ node -e "console.log('Hello from Node.js ' + process.jsEngine)"
Hello from Node.js chakracore

macOS

Prerequisites:

Install the building tools:

$ xcode-select --install
$ brew install cmake

Clone this repo and check out master branch:

$ git checkout master

Build:

$ ./configure
$ make 

To test if Node.js was built correctly with ChakraCore:

$ ./node -e "console.log('Hello from Node.js ' + process.jsEngine)"
Hello from Node.js chakracore

Issues

Please report all issues related to Node-ChakraCore on our issues page.