Napa.js: a multi-threaded JavaScript runtime
Перейти к файлу
microsoft-github-policy-service[bot] 0c95ef4115
Microsoft mandatory file
2022-08-29 14:03:06 +00:00
benchmark Update READMEs for the examples and fixed some grammatical errors in transport.md (#272) 2018-10-29 13:41:12 -07:00
docs Fixed 8 typo errors in the log.md files (#274) 2018-10-29 13:43:13 -07:00
examples Update READMEs for the examples and fixed some grammatical errors in transport.md (#272) 2018-10-29 13:41:12 -07:00
inc fix build/test break introduced by v8 breaking change from node v10.x (#224) 2018-04-24 20:32:41 -07:00
lib Fix load() implementation of transportable object (#216) 2018-04-18 17:43:23 -07:00
node Timers related function, set/clear Immediate/Timeout/Interval (#207) 2018-04-04 16:47:03 -07:00
scripts Fix some small typos (#267) 2018-10-29 13:32:43 -07:00
src Started sentence with 'A' instead of 'a'. (#264) 2018-10-22 11:39:44 -07:00
test Fix assert.ifError() usage in test (#233) 2018-05-18 17:22:13 -07:00
third-party Update 3rd party library 'args' to latest version (7bf1700) (#215) 2018-04-03 23:11:37 -07:00
unittest Timers related function, set/clear Immediate/Timeout/Interval (#207) 2018-04-04 16:47:03 -07:00
.gitignore convert transport builtin types test to TypeScript (#168) 2017-12-23 08:49:09 -08:00
.npmignore Add file npm-debug.log to ignore list (#159) 2017-12-14 14:49:47 -08:00
.travis.yml Fix crash on some linux environment (#229) 2018-05-01 17:58:33 -07:00
CMakeLists.txt Fix crash on some linux environment (#229) 2018-05-01 17:58:33 -07:00
LICENSE.txt Merged PR 327505: Merge dev/dapeng/license to master 2017-07-19 00:29:19 +00:00
README.md Made some fixes in transport-js-builtins.md (#271) 2018-10-29 13:38:36 -07:00
SECURITY.md Microsoft mandatory file 2022-08-29 14:03:06 +00:00
appveyor.yml Fix crash on some linux environment (#229) 2018-05-01 17:58:33 -07:00
build.bat Added a script for building napa in embed mode (#47) 2017-08-28 17:21:13 -07:00
build.js Added a script for building napa in embed mode (#47) 2017-08-28 17:21:13 -07:00
package.json Add cmake-js to devDependencies (#246) 2018-07-23 00:02:54 -07:00

README.md

Build Status for Linux/MacOS Build Status for Windows npm version Downloads

Napa.js

Napa.js is a multi-threaded JavaScript runtime built on V8, which was originally designed to develop highly iterative services with non-compromised performance in Bing. As it evolves, we find it useful to complement Node.js in CPU-bound tasks, with the capability of executing JavaScript in multiple V8 isolates and communicating between them. Napa.js is exposed as a Node.js module, while it can also be embedded in a host process without Node.js dependency.

Installation

Install the latest stable version:

npm install napajs

Other options can be found in Build Napa.js.

Quick Start

const napa = require('napajs');
const zone1 = napa.zone.create('zone1', { workers: 4 });

// Broadcast code to all 4 workers in 'zone1'.
zone1.broadcast('console.log("hello world");');

// Execute an anonymous function in any worker thread in 'zone1'.
zone1.execute(
    (text) => text, 
    ['hello napa'])
    .then((result) => {
        console.log(result.value);
    });

More examples:

Features

  • Multi-threaded JavaScript runtime.
  • Node.js compatible module architecture with NPM support.
  • API for object transportation, object sharing and synchronization across JavaScript threads.
  • API for pluggable logging, metric and memory allocator.
  • Distributed as a Node.js module, as well as supporting embed scenarios.

Documentation

Contribute

You can contribute to Napa.js in following ways:

  • Report issues and help us verify fixes as they are checked in.
  • Review the source code changes.
  • Contribute to core module compatibility with Node.
  • Contribute bug fixes.

This project has adopted the Microsoft Open Source Code of Conduct.
For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.

License

Copyright (c) Microsoft Corporation. All rights reserved.

Licensed under the MIT License.