Node.js on top of SpiderMonkey
Switch branches/tags
Nothing to show
Clone or download
Latest commit 8a1bb2b Nov 27, 2017
Failed to load latest commit information.
.github Merge remote-tracking branch 'nodejs-upstream/master' into merge-node Jan 11, 2017
benchmark benchmark: update obsolete information pointer Mar 26, 2017
deps sync al of taskcluster/ Dec 13, 2017
doc doc: update and modernize examples in Mar 27, 2017
lib Merge remote-tracking branch 'nodejs-upstream/master' into merge-node Mar 27, 2017
src Merge remote-tracking branch 'nodejs-upstream/master' into merge-node Mar 27, 2017
test Merge remote-tracking branch 'nodejs-upstream/master' into merge-node Mar 27, 2017
tools Merge remote-tracking branch 'nodejs-upstream/master' into merge-node Mar 27, 2017
.editorconfig tools: disallow trailing whitespace for markdown Nov 21, 2016
.eslintignore benchmark: don't lint autogenerated modules Jan 12, 2017
.eslintrc.yaml tools: ignore URLs in line length linting Mar 21, 2017
.gitattributes src: limit .gitattributes eol to vcbuild.bat Jan 13, 2015
.gitignore Merge remote-tracking branch 'node/master' into nodemerge Dec 19, 2016
.mailmap doc: update collaborator email address Mar 23, 2017
.remarkrc doc: enable no-file-name-articles remark-lint rule Sep 27, 2016
.travis.yml don't specify --with-clang Mar 13, 2017
AUTHORS doc: update AUTHORS list to fix name Jan 23, 2017
BSDmakefile node: rename from io.js to node Aug 23, 2015 Merge remote-tracking branch 'nodejs-upstream/master' into merge-node Mar 27, 2017 2017-03-21, Version 7.7.4 (Current) Mar 21, 2017 doc: enable first-heading-level remark-lint rule Sep 27, 2016 doc: typographical fixes in Feb 4, 2017 build: add cpp linting to windows build Mar 17, 2017 doc: update minute-taking procedure for CTC Nov 6, 2016
LICENSE deps: switch to v8_inspector in V8 Feb 22, 2017
Makefile build: add rule to clean addon tests build Feb 26, 2017 update README to state current goal Jul 3, 2017
android-configure build: don't create directory for NDK toolchain Mar 22, 2017
common.gypi ignore v8_postmortem_support unless node_engine=v8 Apr 3, 2017
configure Merge remote-tracking branch 'nodejs-upstream/master' into merge-node Mar 13, 2017
node.gyp update cctest target for upstream changes Apr 3, 2017
node.gypi finish moving conditions from node.gyp to node.gypi Apr 3, 2017
vcbuild.bat Merge remote-tracking branch 'nodejs-upstream/master' into merge-node Mar 27, 2017

SpiderNode: Node.js on SpiderMonkey

This project is a port of Node.js on top of SpiderMonkey, the JavaScript engine in Firefox. We're still in the very early stages of the port, and a lot of work remains to be done before Node works.

Build Status


Our current goal is to finish SpiderShim to the extent necessary for Node.js to work. In the future, we may look into finishing implementing the features of the V8 API that Node.js does not use, in order to provide a V8 API shim layer out of the box in SpiderMonkey. The SpiderShim code is being developed with that long term goal in mind.

How it works

To enable building and running Node.js with SpiderMonkey, a V8 API shim (SpiderShim) is created on top of the SpiderMonkey API. This is based on Microsoft's node-chakracore, but it doesn't share much code with it besides the build system integration.

Current status

This is a work in progress. Node can now be successfully built on top of SpiderMonkey, and the very basics seem to work, but there are probably still a lot of issues to discover and fix.

We have implemented a fair portion of the V8 API. More specifically these tests are currently passing. Many of those tests have been ported from the V8 API tests.

How to build

Before building please make sure you have the prerequisites for building Node.js as documented here.

Building on any OS other than Linux or OS X has not been tested.

Build Command:

$ ./configure [options]
$ make
$ ./node -e 'console.log("hello from " + process.jsEngine)'
hello from spidermonkey

Where options is zero or more of:

  • --engine: The JavaScript engine to use. The default engine is spidermonkey.
  • --debug: Also build in debug mode. The default build configuration is release.
  • --enable-gczeal: Enable SpiderMonkey gc-zeal support. This is useful for debugging GC rooting correctness issues.
  • --with-external-spidermonkey-release and --with-external-spidermonkey-debug: Enable building against an out-of-tree SpiderMonkey. Expects a path to a built SpiderMonkey object directory (in release and debug modes, respectively)

If you build against an out-of-tree SpiderMonkey, you must include the SpiderMonkey library path in LD_LIBRARY_PATH (DYLD_LIBRARY_PATH on Mac) when running Node, i.e.:

$ LD_LIBRARY_PATH=path/to/obj-dir/dist/bin ./node -e 'console.log("hello from " + process.jsEngine)'

To run the API tests, do:

$ ./deps/spidershim/scripts/

Repository structure

The repository is based on node-chakracore. The interesting bits can be found in the deps/spidershim directory.

How to update SpiderMonkey from upstream

To update to a newer version of SpiderMonkey, clone mozilla-central using git-cinnabar (or clone the mozilla/gecko mirror of mozilla/central, which is maintained using git-cinnabar) and check out the Gecko revision to which you'd like to update:

git clone path/to/gecko-repo/
cd path/to/gecko-repo/
git checkout revision-id

Then change to the deps/spidershim/ subdirectory of SpiderNode and run the scripts/ script, specifying the path to the Gecko working directory:

cd path/to/spidernode/
cd deps/spidershim/
scripts/ path/to/gecko-repo/

The script will copy the SpiderMonkey files from Gecko and commit changes.

How to update Node from upstream

To update to a newer version of Node, add nodejs/node as a remote, fetch it, and merge the revision to which you'd like to update (f.e. master):

git remote add upstream-node
git fetch upstream-node
git merge upstream-node/master