GithubHelp home page GithubHelp logo

microsoft / napajs Goto Github PK

View Code? Open in Web Editor NEW
9.2K 210.0 341.0 12.73 MB

Napa.js: a multi-threaded JavaScript runtime

License: Other

CMake 1.83% TypeScript 21.53% C++ 68.41% C 0.56% JavaScript 7.64% Batchfile 0.03%
javascript multithreading nodejs napajs runtime parallel multi-core

napajs's Introduction

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 [email protected] with any additional questions or comments.

License

Copyright (c) Microsoft Corporation. All rights reserved.

Licensed under the MIT License.

napajs's People

Contributors

akshitbhalla avatar algram avatar amiyakt avatar asibross avatar daiyip avatar danieljhegeman avatar ethertyper avatar fcarreiro avatar fregante avatar fs-eire avatar gupta2140 avatar hanbitmyths avatar helloshuangzi avatar hemirt avatar ifraixedes avatar itsrauf avatar jakebian avatar jbutz avatar jreidgreer avatar kant avatar limichange avatar ohnx avatar oxund avatar patrickjs avatar pujanm avatar ruturaj123 avatar shlavocky avatar sunitasen avatar tlhunter avatar zhanghuanrong avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

napajs's Issues

[UBUNTU] libstdc++.so.6: version `CXXABI_1.3.9' not found

I, this is my dev env :

Node Version: 7.10.0
Npm Version: 4.2.0
OS: UBUNTU

A simple require of napajs generates this error :
Error: /usr/lib/x86_64-linux-gnu/libstdc++.so.6: version 'CXXABI_1.3.9' not found

Is it possible to "force" napa.js to use the version of the os?
With a variable environment?

Or another solution?

Thank you in advance

Error: /usr/lib/x86_64-linux-gnu/libstdc++.so.6: version `CXXABI_1.3.9' not found on Bitbucket pipelines CI

I try to set up CI integration on bitbucket pipelines, Project compiles fine on my Machine (Windows 10)
I am a c++ noop but I feel there is an older c++ compiler version installes on bitbucket? Does anyone know how to work around this problem?

Error: /usr/lib/x86_64-linux-gnu/libstdc++.so.6: version `CXXABI_1.3.9' not found (required by /opt/atlassian/pipelines/agent/build/node_modules/napajs/bin/napa-binding.node)
    at Object.Module._extensions..node (module.js:664:18)
    at Module.load (module.js:554:32)
    at tryModuleLoad (module.js:497:12)
    at Function.Module._load (module.js:489:3)
    at Module.require (module.js:579:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/opt/atlassian/pipelines/agent/build/node_modules/napajs/lib/binding.js:22:22)
    at Module._compile (module.js:635:30)
    at Module.replacementCompile (/opt/atlassian/pipelines/agent/build/node_modules/nyc/node_modules/append-transform/index.js:58:13)
    at module.exports (/opt/atlassian/pipelines/agent/build/node_modules/nyc/node_modules/default-require-extensions/js.js:8:9)
    at Object.<anonymous> (/opt/atlassian/pipelines/agent/build/node_modules/nyc/node_modules/append-transform/index.js:62:4)
    at Module.load (module.js:554:32)
    at tryModuleLoad (module.js:497:12)
    at Function.Module._load (module.js:489:3)
    at Module.require (module.js:579:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/opt/atlassian/pipelines/agent/build/node_modules/napajs/lib/log.js:5:15)
    at Module._compile (module.js:635:30)
    at Module.replacementCompile (/opt/atlassian/pipelines/agent/build/node_modules/nyc/node_modules/append-transform/index.js:58:13)
    at module.exports (/opt/atlassian/pipelines/agent/build/node_modules/nyc/node_modules/default-require-extensions/js.js:8:9)
    at Object.<anonymous> (/opt/atlassian/pipelines/agent/build/node_modules/nyc/node_modules/append-transform/index.js:62:4)
    at Module.load (module.js:554:32)
    at tryModuleLoad (module.js:497:12)
    at Function.Module._load (module.js:489:3)
    at Module.require (module.js:579:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/opt/atlassian/pipelines/agent/build/node_modules/napajs/lib/index.js:5:13)
    at Module._compile (module.js:635:30)
    at Module.replacementCompile (/opt/atlassian/pipelines/agent/build/node_modules/nyc/node_modules/append-transform/index.js:58:13)
    at module.exports (/opt/atlassian/pipelines/agent/build/node_modules/nyc/node_modules/default-require-extensions/js.js:8:9)
    at Object.<anonymous> (/opt/atlassian/pipelines/agent/build/node_modules/nyc/node_modules/append-transform/index.js:62:4)
    at Module.load (module.js:554:32)
    at tryModuleLoad (module.js:497:12)
    at Function.Module._load (module.js:489:3)
    at Module.require (module.js:579:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/opt/atlassian/pipelines/agent/build/test/metabolic-device-2-data-decoder-thread.spec.js:6:12)
    at Module._compile (module.js:635:30)
    at Module.replacementCompile (/opt/atlassian/pipelines/agent/build/node_modules/nyc/node_modules/append-transform/index.js:58:13)
    at module.exports (/opt/atlassian/pipelines/agent/build/node_modules/nyc/node_modules/default-require-extensions/js.js:8:9)
    at Object.<anonymous> (/opt/atlassian/pipelines/agent/build/node_modules/nyc/node_modules/append-transform/index.js:62:4)
    at Module.load (module.js:554:32)
    at tryModuleLoad (module.js:497:12)
    at Function.Module._load (module.js:489:3)
    at Module.require (module.js:579:17)
    at require (internal/module.js:11:18)
    at /opt/atlassian/pipelines/agent/build/node_modules/mocha/lib/mocha.js:231:27
    at Array.forEach (<anonymous>)
    at Mocha.loadFiles (/opt/atlassian/pipelines/agent/build/node_modules/mocha/lib/mocha.js:228:14)
    at Mocha.run (/opt/atlassian/pipelines/agent/build/node_modules/mocha/lib/mocha.js:514:10)
    at Object.<anonymous> (/opt/atlassian/pipelines/agent/build/node_modules/mocha/bin/_mocha:480:18)
    at Module._compile (module.js:635:30)
    at Module.replacementCompile (/opt/atlassian/pipelines/agent/build/node_modules/nyc/node_modules/append-transform/index.js:58:13)
    at module.exports (/opt/atlassian/pipelines/agent/build/node_modules/nyc/node_modules/default-require-extensions/js.js:8:9)
    at Object.<anonymous> (/opt/atlassian/pipelines/agent/build/node_modules/nyc/node_modules/append-transform/index.js:62:4)
    at Module.load (module.js:554:32)
    at tryModuleLoad (module.js:497:12)
    at Function.Module._load (module.js:489:3)
    at Function.Module.runMain (module.js:676:10)
    at runMain (/root/.node-spawn-wrap-91-c99d2e9be88d/node:68:10)
    at Function.<anonymous> (/root/.node-spawn-wrap-91-c99d2e9be88d/node:171:5)
    at Object.<anonymous> (/opt/atlassian/pipelines/agent/build/node_modules/nyc/bin/wrap.js:23:4)
    at Module._compile (module.js:635:30)
    at Object.Module._extensions..js (module.js:646:10)
    at Module.load (module.js:554:32)
    at tryModuleLoad (module.js:497:12)
    at Function.Module._load (module.js:489:3)
    at Function.Module.runMain (module.js:676:10)
    at /root/.node-spawn-wrap-91-c99d2e9be88d/node:178:8
    at Object.<anonymous> (/root/.node-spawn-wrap-91-c99d2e9be88d/node:181:3)
    at Module._compile (module.js:635:30)
    at Object.Module._extensions..js (module.js:646:10)
    at Module.load (module.js:554:32)
    at tryModuleLoad (module.js:497:12)
    at Function.Module._load (module.js:489:3)
    at Function.Module.runMain (module.js:676:10)
    at startup (bootstrap_node.js:187:16)
    at bootstrap_node.js:608:3

`GLIBCXX_3.4.22' not found

follow the steps in estimate-pi-in-parallel
testes in ubuntu 16.04

$ node estimate-pi-in-parallel.js
module.js:653
  return process.dlopen(module, path._makeLong(filename));
                 ^

Error: /usr/lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.22' not found (required by /home/tigercosmos/Desktop/napajs/examples/tutorial/estimate-pi-in-parallel/node_modules/napajs/bin/libnapa.so)
    at Object.Module._extensions..node (module.js:653:18)
    at Module.load (module.js:545:32)
    at tryModuleLoad (module.js:508:12)
    at Function.Module._load (module.js:500:3)
    at Module.require (module.js:568:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/home/tigercosmos/Desktop/napajs/examples/tutorial/estimate-pi-in-parallel/node_modules/napajs/lib/binding.js:5:22)
    at Module._compile (module.js:624:30)
    at Object.Module._extensions..js (module.js:635:10)
    at Module.load (module.js:545:32)

Illegal instruction / runtime-promise

If you change the Fibonacci example to:

// Run fibonacci evaluation in sequence.
run(20)

Sometime you receive:

Fatal error in ../deps/v8/src/runtime/runtime-promise.cc, line 59
Check failed: args[0]->IsJSPromise().
Illegal instruction

Sometimes a segmentation fault:

  Nth     Fibonacci       # of workers    latency in MS
    -----------------------------------------------------------

run n: 20
Segmentation fault

This happen running with debian 9.2

Issue running on OSX 10.12.5

Running Node 6.11.2 and getting the following error

module.js:597
  return process.dlopen(module, path._makeLong(filename));
                 ^

Error: dlopen(/Users/rashid/Yellow-Messenger/node-threded/node_modules/napajs/bin/napa-binding.node, 1): Library not loaded: @rpath/libnapa.dylib
  Referenced from: /Users/rashid/Yellow-Messenger/node-threded/node_modules/napajs/bin/napa-binding.node
  Reason: image not found
    at Error (native)
    at Object.Module._extensions..node (module.js:597:18)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/Users/rashid/Yellow-Messenger/node-threded/node_modules/napajs/lib/binding.js:5:22)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)```

Napajs does not work on node 8.8.1+

Napajs does not work with Nodejs of 8.8.1+ version.

  • on Windows it shows error: "Error: Invalid access to memory location."
  • on Linux error looks like: "Error: The module '.../napajs/bin/napa-binding.node' was compiled against a different Node.js version using NODE_MODULE_VERSION 57. This version of Node.js requires NODE_MODULE_VERSION 54. Please try re-compiling or re-installing the module.

I tried to rebuild napajs with "npm rebuild napajs --force" but it has no effect.

Napa JS store mangles UTF-8 strings

Sample code:

const napa = require("napajs");
const fs = require("fs");

const myUTFString="éóíúã’“";

const zone = napa.zone.create("zone", {workers: 1});
const store = napa.store.create("store");
store.set("string", myUTFString);

zone.broadcast(`
    function example () {
        const str = global.napa.store.get("store").get("string");
        console.log(str);
        return str;
    }
`);

zone.execute("", "example").then(result => {
    console.log(result.value)
});

Expected output:

éóíúã’“
éóíúã’“

Actual output:

éóíúã��
éóíúã��

This is on Windows 10.

[MSVC] #include "napa.h" cannot surpress warning C4100

header file napa/module.h uses #pragma to disable warning C4100 when including v8.h.

napa.h contains napa/module.h, however it fails to disable that warning because v8.h is included before napa/module.h

Current workaround:

#include "napa.h"
// this produces the warning

change to

#include "napa/module.h"
#include "napa.h"
// no warning now.

Library not loaded: @rpath/libnapa.dylib

Getting this error when trying to run a script that uses napajs. Tested using recursive-fibonacci as well.

colton is in ~/Code/napajs/examples/tutorial/recursive-fibonacci on (branch:master)
»  node recursive-fibonacci.js
module.js:598
  return process.dlopen(module, path._makeLong(filename));
                 ^

Error: dlopen(/Users/colton/node_modules/napajs/bin/napa-binding.node, 1): Library not loaded: @rpath/libnapa.dylib
  Referenced from: /Users/colton/node_modules/napajs/bin/napa-binding.node
  Reason: image not found
    at Object.Module._extensions..node (module.js:598:18)
    at Module.load (module.js:503:32)
    at tryModuleLoad (module.js:466:12)
    at Function.Module._load (module.js:458:3)
    at Module.require (module.js:513:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/Users/colton/node_modules/napajs/lib/binding.js:5:22)
    at Module._compile (module.js:569:30)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:503:32)

Fail to run web server with Napa module

Hello
I am very new to use Napa module and just implemented a hello world web server using Napa module. This web server just prints "Hello Napa" in parallel by multiple threads. However, the problem is this web server cannot respond to client. I am not sure if the reason is Napa module does not support node express or http module or else. I know Napa has two zones, one is napa zone and the other is node zone, if napa does not support http or express module, how can I use node zone to compensate that? Thanks!
I put my code below,

var napa = require('napajs');
var app = require('express')();
var Promise = require('promise');

const NUMBER_OF_WORKERS = 4
	, PORT = 3005
	, HOST = '0.0.0.0';
	
var zone = napa.zone.create('zone', { workers: NUMBER_OF_WORKERS });
app.listen(PORT, HOST);

function startParellelRun(){	
	app.get('/', (req, res) => {
		run().then(() => {
			res.status(200).send('OK');
		}).catch(() => {
			res.status(500).send('ERROR');
		});		
	});
}

function run(){	
	var promises = [];	
	for(var i = 0; i < NUMBER_OF_WORKERS; i++){
		promises[i] = zone.execute(hello, [i]);		
	}	
	return Promise.all(promises)
			.then((values) => {			
				values.forEach((ele) => {
					console.log(ele.value);
				});				
			});								
}

function hello(i){
	return 'Hello Napa! I am Worker ' + i;
}

startParellelRun();

Node zone hang on recursive `zone.execute`

Code

var napa = require('napajs');
var node = napa.zone.node;

function test(n) {
    if (n == 2) 
        return;
    
    console.log("Forward trace", n);
    return node.execute(test, [n + 1])
        .then(() => console.log('Back trace', n));
}

node.execute(test, [0])
   .catch(err => console.log(err))
   .then(() => { console.log('Finished'); });

Expected

Forward trace 0
Forward trace 1
Back trace 1
Back trace 0
Finished

Actual

Forward trace 0
Forward trace 1
<program hang>

Other comments

Napa zone with 1 worker works as expected.

Add cache for module file resolution during 'require'

Code

function test() {
    var m = require('some-module');
}

Expected

Only performance hit from require.resolve on first require, afterwards it would be very fast.

Actual

We only have module cache on canonical path, every require will do require.resolve, which involves a lot of IO on file lookup.

Add 'description' field in package.json

Issue:

Now npm search will show snippet from README.md, which is

[![Build Status for Linux/MacOS](https://travis-ci.org/Microsoft/napajs.svg?branch=master)](https://travis-ci.org/Microsoft/napajs) [![Build Status for Windows](https://ci.appveyor.com/api/projects/status/github/Microsoft/napajs?branch=master&svg=true)](

Adding "description" field in package.json will solve this.

Why not just rewrite node.

That or you know, there's an NPM module called clustering out there. That's all this really is, glorified clustering. Even though I had better luck with symbols in clustering. I would switch to something like C.

[UNIX] Prebuilt binaries are not working.

Problem

Pre-built binaries are not working on Linux and MacOS.

npm install napajs
node -e "require('napajs')"

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

Solution

Update napa.js to version 0.1.4 or later to resolve this issue.

Workaround

1. export LD_LIBRARY_PATH=./node_modules/napajs/bin:$LD_LIBRARY_PATH before launch node.
2. Use npm install --no-fetch so the install script will fallback to build napajs. See this for more information.

Root Cause

The file 'napa-binding.node' was using absolute path in its rpath before v0.1.4. This causes the pre-built file cannot be loaded in runtime.

Unable to complete all tasks

Can not finish 7 tasks on my computer, sometimes only finished 5, sometimes there will be errors.

20171023090504

nodejs v8.5 win7 x64 i5-4300U

Why does the accuracy of the pi approx reduces for large worker numbers?

At the moment the docs show the following table in https://github.com/Microsoft/napajs/tree/master/examples/tutorial/estimate-pi-in-parallel

# of points     # of batches    # of workers    latency in MS   estimated π     deviation
---------------------------------------------------------------------------------------
4000000         1               4               218             3.141958        0.0003653464
4000000         2               4               110             3.141953        0.0003603464
4000000         4               4               78              3.139600        0.001992654
4000000         8               4               62              3.142732        0.001139346

I would expect that the number of batches would not effect the accuracy of the estimate.
But it looks like there is a big dependence on it - which I'm guessing is due to reusing the same
RNG seeds or something like that.

Either way the source of that issue should be explained.

provide DEB and RPM packages?

Hi guys, wouldn't it be something cool to get a .deb or .rpm package available?

It would be easier for those willing to went native with NapaJS instead of using it as a NodeJS module.
Plus, this would also accelerate a widespread adoption.

Example (node-gyp based) napa module build failure on macOS

The following examples can build on Windows and Linux, but fail on macOS

Error message:

SOLINK(target) Release/../../bin/addon.napa
Undefined symbols for architecture x86_64:
"v8::HandleScope::HandleScope(v8::Isolate*)", referenced from:
void napa::module::SetMethod<v8::Localv8::Object >(v8::Localv8::Object const&, char const*, void (*)(v8::FunctionCallbackInfov8::Value const&)) in addon.o
"v8::HandleScope::~HandleScope()", referenced from:
void napa::module::SetMethod<v8::Localv8::Object >(v8::Localv8::Object const&, char const*, void (*)(v8::FunctionCallbackInfov8::Value const&)) in addon.o
"v8::FunctionTemplate::GetFunction()", referenced from:
void napa::module::SetMethod<v8::Localv8::Object >(v8::Localv8::Object const&, char const*, void (*)(v8::FunctionCallbackInfov8::Value const&)) in addon.o
"v8::FunctionTemplate::New(v8::Isolate*, void ()(v8::FunctionCallbackInfov8::Value const&), v8::Localv8::Value, v8::Localv8::Signature, int, v8::ConstructorBehavior)", referenced from:
void napa::module::SetMethod<v8::Localv8::Object >(v8::Localv8::Object const&, char const
, void (*)(v8::FunctionCallbackInfov8::Value const&)) in addon.o
"v8::Object::Set(v8::Localv8::Value, v8::Localv8::Value)", referenced from:
void napa::module::SetMethod<v8::Localv8::Object >(v8::Localv8::Object const&, char const*, void (*)(v8::FunctionCallbackInfov8::Value const&)) in addon.o
"v8::String::NewFromUtf8(v8::Isolate*, char const*, v8::String::NewStringType, int)", referenced from:
napa::demo::Method(v8::FunctionCallbackInfov8::Value const&) in addon.o
void napa::module::SetMethod<v8::Localv8::Object >(v8::Localv8::Object const&, char const*, void (*)(v8::FunctionCallbackInfov8::Value const&)) in addon.o
"v8::Isolate::GetCurrent()", referenced from:
void napa::module::SetMethod<v8::Localv8::Object >(v8::Localv8::Object const&, char const*, void (*)(v8::FunctionCallbackInfov8::Value const&)) in addon.o
"v8::Function::SetName(v8::Localv8::String)", referenced from:
void napa::module::SetMethod<v8::Localv8::Object >(v8::Localv8::Object const&, char const*, void (*)(v8::FunctionCallbackInfov8::Value const&)) in addon.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [Release/../../bin/addon.napa] Error 1

Any plans for native TypeScript? ;)

Any future plans for embedding ts-node or straight-up TS support?
( ͡° ͜ʖ ͡°)

(You knew this issue was going to happen at some point.)

Missing license

Under which license this project is released? Since most of the Microsoft open source work is released under MIT i recommend this license. Great project btw. like a lot of the Microsoft projects 👍

Library not loaded: @rpath/libnapa.dylib

I install napa by npm install napa, then run the demo beblow

var napa = require('napajs');
var 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);
    });

I get this error

Error: dlopen(/Xxx/testplace/napa/node_modules/.0.1.3@napajs/bin/napa-binding.node, 1): Library not loaded: @rpath/libnapa.dylib
  Referenced from: /Xxx/testplace/napa/node_modules/.0.1.3@napajs/bin/napa-binding.node
  Reason: image not found

how to solve it?

Build warning in latest node version (MSVC2017 + Node8.3.0)

....cmake-js\node-x64\v8.3.0\include\node\v8.h(4150): warning C4251: 'v8::WasmModuleObjectBuilder::received_buffers_': class 'std::vector<v8::WasmModuleObjectBuilder::Buffer,std::allocator<_Ty>>' needs to have dll-interface to be used by clients of class 'v8::WasmModuleObjectBuilder'

Inconsistency for napa/node zone when accessing '__dirname' in global module

let napaZone = napa.zone.create('test-dirname-zone', { workers: 1 });
let nodeZone = napa.zone.node;

napaZone.broadcast('var getDirname = function () { return __dirname; };');
nodeZone.broadcast('var getDirname = function () { return __dirname; };');

Napa Zone

napaZone.execute("", "getDirname")

This returns the working directory.

Node Zone

nodeZone.execute("", "getDirname")

This throws exception saying that '__dirname' is undefined.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.