Skip to content
This repository has been archived by the owner on Jun 13, 2024. It is now read-only.
Yulong Wang edited this page Oct 19, 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

Linux

Q: I run the command npm install napajs. Why it fails with following message:

module.js:597
return process.dlopen(module, path._makeLong(filename));
^
Error: libnapa.so: cannot open shared object file: No such file or directory

A: It's a known issue in Napajs v0.1.13. Please refer to Issue #80 for workaround and updates.

Q: I run the command npm install napajs. Why it fails with following message:

/usr/lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.22' not found

A: You didn't install the latest libstdc++6 libraries. Use the following command to install:

sudo apt-get install libstdc++6

Note: this issue only happens when you are using the pre-built binaries. You do not have to depends on libstdc++6 if you build napajs by yourself.

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