Skip to content
This repository has been archived by the owner on Jun 13, 2024. It is now read-only.
Daiyi Peng edited this page Aug 7, 2017 · 17 revisions

Table of Contents

General

Q: Why Napa.js? When should I use it?

A: Here is a longer version. In short, Napa.js provides a multi-threaded JavaScript programming model that enables developers to write computation heavy code in JavaScript, without blocking Node event loop.

You should use it when:

  • CPU bound logic that may block Node event loop
  • Complex workflow that may involve parallel execution of JavaScript code

Installation

Windows

Q: I have Visual Studio 2015/2017 installed, why did npm install napajs fail with following message: ""

A:

Functionality

Q: Can I run Node.js modules within Napa.js?

A: Yes and No. Napa.js support modules in the same way as Node.js does, but at present Napa.js doesn't support all Node.js built-in and core modules. If the module you want to use doesn't depend (directly or indirectly) on them, then you can use it, otherwise you cannot.

Q: Can I access variables from different JavaScript thread?

A: In JavaScript, each thread has its own heap, so you cannot access variable from different JavaScript thread. But, there are two ways you can communicate between JavaScript threads.

  1. Passing object by arguments during execute and broadcast
  2. Sharing objects via store API

Design considerations

Clone this wiki locally