Node.js on ChakraCore 🐢🚀
Clone or download
dilijev and chakrabot deps: update ChakraCore to Microsoft/ChakraCore@558f84b
[MERGE #5765 @dilijev] Update release/1.11 to version 1.11.2

Merge pull request #5765 from dilijev:version-1.11.2

Reviewed-By: chakrabot <chakrabot@users.noreply.github.com>
Latest commit e179323 Oct 10, 2018
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 Sep 11, 2018
deps deps: update ChakraCore to Microsoft/ChakraCore@558f84b Oct 10, 2018
doc meta: merge node/master into node-chakracore/master Oct 9, 2018
lib build: remove object spread which is not supported in ChakraCore Oct 9, 2018
src meta: merge node/master into node-chakracore/master Oct 9, 2018
test meta: merge node/master into node-chakracore/master Oct 9, 2018
tools meta: merge node/master into node-chakracore/master Oct 9, 2018
.clang-format tools: add `make format-cpp` to run clang-format on C++ diffs Aug 3, 2018
.editorconfig tools: unify .editorconfig rules for 2-space Oct 1, 2018
.eslintignore tools: use lint-md.js Sep 11, 2018
.eslintrc.js tools: .eslintrc.js messages "default" typo style Sep 24, 2018
.gitattributes src: limit .gitattributes eol to vcbuild.bat Jan 13, 2015
.gitignore tools: use lint-md.js Sep 11, 2018
.mailmap doc: update AUTHORS list Sep 14, 2018
.nycrc test: fix tests that fail under coverage May 22, 2018
.travis.yml build,doc: remove outdated `lint-md-build` Sep 22, 2018
AUTHORS doc: update AUTHORS list Sep 14, 2018
BSDmakefile node: rename from io.js to node Aug 23, 2015
BUILDING.md doc: add table of contents in BUILDING.md Sep 29, 2018
CHANGELOG.md 2018-09-20, Version 10.11.0 (Current) Sep 20, 2018
CODE_OF_CONDUCT.md doc: move Code of Conduct to admin repo Nov 28, 2017
COLLABORATOR_GUIDE.md doc: remove recommendation to use node-eps Oct 2, 2018
CONTRIBUTING.md doc: add contents table to CONTRIBUTING.md Oct 1, 2018
CPP_STYLE_GUIDE.md doc: formalize `auto` usage in C++ style guide Sep 30, 2018
GOVERNANCE.md doc: require two approvals to land changes Sep 25, 2018
LICENSE tools: use lint-md.js Sep 11, 2018
Makefile meta: merge node/master into node-chakracore/master Oct 9, 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 Sep 25, 2018
configure build: move meta-shebang back to `configure` Sep 7, 2018
configure.py meta: merge node/master into node-chakracore/master Sep 20, 2018
node.gyp meta: merge node/master into node-chakracore/master Sep 27, 2018
node.gypi meta: merge node/master into node-chakracore/master Sep 13, 2018
vcbuild.bat meta: merge node/master into node-chakracore/master Sep 24, 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.