:sparkles: Magical headers that make your C++ library accessible from JavaScript :rocket:

Overview

Quick start | Requirements | Features | User guide | Contributing | License

nbind flowchart

nbind is a set of headers that make your C++11 library accessible from JavaScript. With a single #include statement, your C++ compiler generates the necessary bindings without any additional tools. Your library is then usable as a Node.js addon or, if compiled to asm.js with Emscripten, directly in web pages without any plugins.

nbind works with the autogypi dependency management tool, which sets up node-gyp to compile your library without needing any configuration (other than listing your source code file names).

nbind is MIT licensed and based on templates and macros inspired by embind.

Quick start

C++ everywhere in 5 easy steps using Node.js, nbind and autogypi:

Starting point Step 1 - bind Step 2 - prepare
Original C++ code hello.cc:
#include <string>
#include <iostream>
 
struct Greeter {
  static void sayHello(
    std::string name
  ) {
    std::cout
      << "Hello, "
      << name << "!\n";
  }
};
List your classes and methods:
// Your original code here
 
// Add these below it:
 
#include "nbind/nbind.h"
 
NBIND_CLASS(Greeter) {
  method(sayHello);
}
Add scripts to package.json:
{
  "scripts": {
    "autogypi": "autogypi",
    "node-gyp": "node-gyp",
    "emcc-path": "emcc-path",
    "copyasm": "copyasm",
    "ndts": "ndts"
  }
}
Step 3 - install Step 4 - build Step 5 - use!
Run on the command line:
npm install --save \
  nbind autogypi node-gyp
 
npm run -- autogypi \
  --init-gyp \
  -p nbind -s hello.cc
Compile to native binary:
npm run -- node-gyp \
  configure build
Or to Asm.js:
npm run -- node-gyp \
  configure build \
  --asmjs=1
Call from Node.js:
var nbind = require('nbind');
var lib = nbind.init().lib;
 
lib.Greeter.sayHello('you');
Or from a web browser (see below).

The above is all of the required code. Just copy and paste in the mentioned files and prompts or take a shortcut:

git clone https://github.com/charto/nbind-example-minimal.git
cd nbind-example-minimal
npm install && npm test

See it run!

(Note: nbind-example-universal is a better starting point for development)

Requirements

You need:

And one of the following C++ compilers:

  • GCC 4.8 or above.
  • Clang 3.6 or above.
  • Emscripten 1.35.0 or above.
  • Visual Studio 2015 (the Community version is fine).

Features

nbind allows you to:

  • Use your C++ API from JavaScript without any extra effort.
    • From Node.js, Electron and web browsers (using asm.js on Chrome, Firefox and Edge).
    • On Linux, OS X and Windows.
    • Without changes to your C++ code. Simply add a separate short description at the end.
  • Distribute both native code and an asm.js fallback binary.
  • Automatically generate TypeScript .d.ts definition files from C++ code for IDE autocompletion and compile-time checks of JavaScript side code.

In more detail:

  • Export multiple C++ classes, even ones not visible from other files.
  • Export C++ methods simply by mentioning their names.
  • Auto-detect argument and return types from C++ declarations.
  • Automatically convert types and data structures between languages.
  • Call C++ methods from JavaScript with type checking.
  • Pass JavaScript callbacks to C++ and call them with any types.
  • Pass instances of compatible classes by value between languages (through the C++ stack).

The goal is to provide a stable API for binding C++ to JavaScript. All internals related to JavaScript engines are hidden away, and a single API already supports extremely different platforms.

Works on your platform

Target Development platform
Linux / OS X Windows
Native Build status Build status
Asm.js Build status Tested manually

dependency status npm version

Roadmap

More is coming! Work is ongoing to:

  • Precompile to a single native library for all versions Node.js and Electron on the same platform
    • Precompiled addons for different Node.js versions for efficiently calling the library will be provided with nbind
  • Support native Android and iPhone apps.

Future 0.x.y versions should remain completely backwards-compatible between matching x and otherwise with minor changes. Breaking changes will be listed in release notes of versions where y equals 0.

Contributing

Please report issues through Github and mention the platform you're targeting (Node.js, asm.js, Electron or something else). Pull requests are very welcome.

Warning: rebase is used within develop and feature branches (but not master).

When developing new features, writing tests first works best. If possible, please try to get them working on both Node.js and asm.js. Otherwise your pull request will get merged to Master only after maintainer(s) have fixed the other platform.

Installing Emscripten to develop for asm.js can be tricky. It will require Python 2.7 and setting paths correctly, please refer to Emscripten documentation. The bin/emcc script in this package is just a wrapper, the actual emcc compiler binary should be in your path.

You can rebuild the asm.js library and run tests as follows:

npm run clean-asm && npm run prepublish && npm run test-asm

User guide

Installing the examples

nbind examples shown in this user guide are also available to download for easier testing as follows:

Extract this zip package or run:

git clone https://github.com/charto/nbind-examples.git

Enter the examples directory and install:

cd nbind-examples
npm install

Creating your project

Once you have all requirements installed, run:

npm init
npm install --save nbind autogypi node-gyp

nbind, autogypi and node-gyp are all needed to compile a native Node.js addon from source when installing it. If you only distribute an asm.js version, you can use --save-dev instead of --save because users won't need to compile it.

Next, to run commands without installing them globally, it's practical to add them in the scripts section of your package.json that npm init just generated. Let's add an install script as well:

  "scripts": {
    "autogypi": "autogypi",
    "node-gyp": "node-gyp",
    "emcc-path": "emcc-path",
    "copyasm": "copyasm",

    "install": "autogypi && node-gyp configure build"
  }

emcc-path is needed internally by nbind when compiling for asm.js. It fixes some command line options that node-gypi generates on OS X and the Emscripten compiler doesn't like. You can leave it out if only compiling native addons.

The install script runs when anyone installs your package. It calls autogypi and then uses node-gyp to compile a native addon.

autogypi uses npm package information to set correct include paths for C/C++ compilers. It's needed when distributing addons on npm so the compiler can find header files from the nbind and nan packages installed on the user's machine. Initialize it like this:

npm run -- autogypi --init-gyp -p nbind -s hello.cc

Replace hello.cc with the name of your C++ source file. You can add multiple -s options, one for each source file.

The -p nbind means the C++ code uses nbind. Multiple -p options can be added to add any other packages compatible with autogypi.

The --init-gyp command generates files binding.gyp and autogypi.json that you should distribute with your package, so that autogypi and node-gyp will know what to do when the install script runs.

Now you're ready to start writing code and compiling.

Configuration

Refer to autogypi documentation to set up dependencies of your package, and how other packages should include it if it's a library usable directly from C++.

--asmjs=1 is the only existing configuration option for nbind itself. You pass it to node-gyp by calling it like node-gyp configure build --asmjs=1. It compiles your package using Emscripten instead of your default C++ compiler and produces asm.js output.

Calling from Node.js

First nbind needs to be initialized by calling nbind.init which takes the following optional arguments:

  • Base path under which to look for compiled binaries. Default is process.cwd() and __dirname is a good alternative.
  • Binary code exports object. Any classes from C++ API exported using nbind will be added as members. Default is an empty object. Any existing options will be seen by asm.js code and can be used to configure Emscripten output. Must follow base path (which may be set to null or undefined).
  • Node-style callback with 2 parameters:
    • Error if present, otherwise null.
    • Binary code exports object containing C++ classes.

nbind can be initialized synchronously on Node.js and asynchronously on browsers and Node.js. Purely synchronous is easier but not as future-proof:

var nbind = require('nbind');
var lib = nbind.init().lib;

// Use the library.

Using a callback also supports asynchronous initialization:

var nbind = require('nbind');

nbind.init(function(err, binding) {
  var lib = binding.lib;

  // Use the library.
});

The callback passed to init currently gets called synchronously in Node.js and asynchronously in browsers. To avoid releasing zalgo you can for example wrap the call in a bluebird promise:

var bluebird = require('bluebird');
var nbind = require('nbind');

bluebird.promisify(nbind.init)().then(function(binding) {
  var lib = binding.lib;

  // Use the library.
});

Using nbind headers

There are two possible files to include:

  • nbind/api.h for using types from the nbind namespace such as JavaScript callbacks inside your C++ code.
    • #include before your own class definitions.
    • Causes your code to depend on nbind.
  • nbind/nbind.h for exposing your C++ API to JavaScript.
    • #include after your own class definitions to avoid accidentally invoking its macros.
    • The header automatically hides itself if not targeting Node.js or asm.js.
    • Safe to use in any projects.

Use #include "nbind/nbind.h" at the end of your source file with only the bindings after it. The header defines macros with names like construct and method that may otherwise break your code or conflict with other headers.

It's OK to include nbind/nbind.h also when not targeting any JavaScript environment. node-gyp defines a BUILDING_NODE_EXTENSION macro and Emscripten defines an EMSCRIPTEN macro so when those are undefined, the include file does nothing.

Use #include "nbind/api.h" in your header files to use types in the nbind namespace if you need to report errors without throwing exceptions, or want to pass around callbacks or objects.

You can use an #ifdef NBIND_CLASS guard to skip your nbind export definitions when the headers weren't loaded.

Example that uses an nbind callback in C++ code:

1-headers.cc

#include <string>
#include <iostream>

// For nbind::cbFunction type.
#include "nbind/api.h"

class HeaderExample {

public:

  static void callJS(nbind::cbFunction &callback) {
    std::cout << "JS says: " << callback.call<std::string>(1, 2, 3);
  }

};

// For NBIND_CLASS() and method() macros.
#include "nbind/nbind.h"

#ifdef NBIND_CLASS

NBIND_CLASS(HeaderExample) {
  method(callJS);
}

#endif

Example used from JavaScript:

1-headers.js

var nbind = require('nbind');

var lib = nbind.init().lib;

lib.HeaderExample.callJS(function(a, b, c) {
  return('sum = ' + (a + b + c) + '\n');
});

Run the example with node 1-headers.js after installing. It prints:

JS says: sum = 6

Functions

Functions not belonging to any class are exported inside an NBIND_GLOBAL block with a macro call function(functionName); which takes the name of the function as an argument (without any quotation marks). The C++ function gets exported to JavaScript with the same name, or it can be renamed by adding a second argument (with quotation marks): function(cppFunctionName, "jsExportedName");

If the C++ function is overloaded, multifunction macro must be used instead. See overloaded functions.

Note: you cannot put several function(...); calls on the same line! Otherwise you'll get an error about redefining a symbol.

Example:

6-functions.cc

#include <iostream>

void sayHello(std::string name) {
  std::cout << "Hello, " << name << "!\n";
}

#include "nbind/nbind.h"

NBIND_GLOBAL() {
  function(sayHello);
}

Example used from JavaScript:

6-functions.js

var nbind = require('nbind');
var lib = nbind.init().lib;

lib.sayHello('you');

Classes and constructors

The NBIND_CLASS(className) macro takes the name of your C++ class as an argument (without any quotation marks), and exports it to JavaScript using the same name. It's followed by a curly brace enclosed block of method exports, as if it was a function definition.

The class can be renamed on the JavaScript side by passing a string as a second argument. This is especially useful for binding a template class specialization with a more reasonable name: NBIND_CLASS(Data<int>, "IntData")

Constructors are exported with a macro call construct<types...>(); where types is a comma-separated list of arguments to the constructor, such as int, int. Calling construct multiple times allows overloading it, but each overload must have a different number of arguments.

Constructor arguments are the only types that nbind cannot detect automatically.

Example with different constructor argument counts and types:

2-classes.cc

#include <iostream>

class ClassExample {

public:

  ClassExample() {
    std::cout << "No arguments\n";
  }
  ClassExample(int a, int b) {
    std::cout << "Ints: " << a << " " << b << "\n";
  }
  ClassExample(const char *msg) {
    std::cout << "String: " << msg << "\n";
  }

};

#include "nbind/nbind.h"

NBIND_CLASS(ClassExample) {
  construct<>();
  construct<int, int>();
  construct<const char *>();
}

Example used from JavaScript:

2-classes.js

var nbind = require('nbind');

var lib = nbind.init().lib;

var a = new lib.ClassExample();
var b = new lib.ClassExample(42, 54);
var c = new lib.ClassExample("Don't panic");

Run the example with node 2-classes.js after installing. It prints:

No arguments
Ints: 42 54
String: Don't panic

Inheritance

When a C++ class inherits another, the inherit macro can be used to allow calling parent class methods on the child class, or passing child class instances to C++ methods expecting parent class instances.

Internally JavaScript only has prototype-based single inheritance while C++ supports multiple inheritance. To simulate it, nbind will use one parent class as the child class prototype, and copy the contents of the other parents to the prototype. This has otherwise the same effect, except the JavaScript instanceof operator will return true for only one of the parent classes.

Example:

NBIND_CLASS(Child) {
    inherit(FirstParent);
    inherit(SecondParent);
}

Methods and properties

Methods are exported inside an NBIND_CLASS block with a macro call method(methodName); which takes the name of the method as an argument (without any quotation marks). The C++ method gets exported to JavaScript with the same name.

If the C++ method is overloaded, multimethod macro must be used instead. See overloaded functions.

Properties should be accessed through getter and setter functions.

Data types of method arguments and its return value are detected automatically so you don't have to specify them. Note the supported data types because using other types may cause compiler errors that are difficult to understand.

If the method is static, it becomes a property of the JavaScript constructor function and can be accessed like className.methodName(). Otherwise it becomes a property of the prototype and can be accessed like obj = new className(); obj.methodName();

Example with a method that counts a cumulative checksum of ASCII character values in strings, and a static method that processes an entire array of strings:

3-methods.cc

#include <string>
#include <vector>

class MethodExample {

public:

  unsigned int add(std::string part) {
    for(char &c : part) sum += c;

    return(sum);
  }

  static std::vector<unsigned int> check(std::vector<std::string> list) {
    std::vector<unsigned int> result;
    MethodExample example;

    for(auto &&part : list) result.push_back(example.add(part));

    return(result);
  }

  unsigned int sum = 0;

};

#include "nbind/nbind.h"

NBIND_CLASS(MethodExample) {
  construct<>();

  method(add);
  method(check);
}

Example used from JavaScript, first calling a method in a loop from JS and then a static method returning an array:

3-methods.js

var nbind = require('nbind');

var lib = nbind.init().lib;

var parts = ['foo', 'bar', 'quux'];

var checker = new lib.MethodExample();

console.log(parts.map(function(part) {
  return(checker.add(part));
}));

console.log(lib.MethodExample.check(parts));

Run the example with node 3-methods.js after installing. It prints:

[ 324, 633, 1100 ]
[ 324, 633, 1100 ]

The example serves to illustrate passing data. In practice, such simple calculations are faster to do in JavaScript rather than calling across languages because copying data is quite expensive.

Overloaded functions

The function() and method() macroes cannot distinguish between several overloaded versions of the same function or method, causing an error. In this case the multifunction() and multimethod() macroes must be used.

Their second parameter is a list of argument types wrapped in an args() macro to select a single overloaded version.

For example consider an overloaded method:

void test(unsigned int x) const;
void test(unsigned int x, unsigned int y) const;

In bindings, one of the versions needs to be explicitly selected. The second of the two would be referenced like:

multimethod(test, args(unsigned int, unsigned int));

As always, the return type and method constness are autodetected.

For calling from JavaScript, additionally each overload needs to have a distinct name. For renaming an overload JavaScript will see, the binding code is like:

multimethod(test, args(unsigned int, unsigned int), "test2");

You can then write a JavaScript wrapper to inspect arguments and select which overload to call. The reason for this is, that nbind binds a JavaScript property to a single C++ function pointer, which wraps one overloaded version of the function with type conversion code.

Otherwise, it would need to generate a new C++ function that also checks the arguments. This would result in a larger native binary without any speed advantage.

Getters and setters

Property getters are exported inside an NBIND_CLASS block with a macro call getter(getterName) with the name of the getter method as an argument. nbind automatically strips a get/Get/get_/Get_ prefix and converts the next letter to lowercase, so for example getX and get_x both would become getters of x to be accessed like obj.x

Property setters are exported together with getters using a macro call getset(getterName, setterName) which works much like getter(getterName) above. Both getterName and setterName are mangled individually so you can pair getX with set_x if you like. From JavaScript, ++obj.x would then call both of them to read and change the property.

Example class and property with a getter and setter:

4-getset.cc

class GetSetExample {

public:

  void setValue(int value) { this->value = value; }
  int getValue() { return(value); }

private:

  int value = 42;

};

#include "nbind/nbind.h"

NBIND_CLASS(GetSetExample) {
  construct<>();

  getset(getValue, setValue);
}

Example used from JavaScript:

4-getset.js

var nbind = require('nbind');

var lib = nbind.init().lib;

var obj = new lib.GetSetExample();

console.log(obj.value++); // 42
console.log(obj.value++); // 43

Run the example with node 4-getset.js after installing.

Passing data structures

nbind supports automatically converting between JavaScript arrays and C++ std::vector or std::array types. Just use them as arguments or return values in C++ methods.

Note that data structures don't use the same memory layout in both languages, so the data always gets copied which takes more time for more data. For example the strings in an array of strings also get copied, one character at a time. In asm.js data is copied twice, first to a temporary space using a common format both languages can read and write.

Callbacks

Callbacks can be passed to C++ methods by simply adding an argument of type nbind::cbFunction & to their declaration.

They can be called with any number of any supported types without having to declare in any way what they accept. The JavaScript code will receive the parameters as JavaScript variables to do with them as it pleases.

A callback argument arg can be called like arg("foobar", 42); in which case the return value is ignored. If the return value is needed, the callback must be called like arg.call<type>("foobar", 42); where type is the desired C++ type that the return value should be converted to. This is because the C++ compiler cannot otherwise know what the callback might return.

Warning: while callbacks are currently passed by reference, they're freed after the called C++ function returns! That's intended for synchronous functions like Array.map which calls a callback zero or more times and then returns. For asynchronous functions like setTimeout which calls the callback after it has returned, you need to copy the argument to a new nbind::cbFunction and store it somewhere.

Using objects

C++ objects can be passed to and from JavaScript using different parameter and return types in C++ code:

  • by reference using pointers or references (optionally const)
  • by value

Note: currently passing objects by pointer on Node.js requires the class to have a "copy constructor" initializing itself from a pointer. This will probably be fixed later.

Returned pointers and references can be const, in which case calling their non-const methods or passing them as non-const parameters will throw an error. This prevents causing undefined behaviour corresponding to C++ code that wouldn't even compile.

Using pointers and references is particularly:

  • dangerous because the pointer may become invalid without JavaScript noticing it.
  • annoying in asm.js because browsers give no access to the garbage collector, so memory may leak when pointers become garbage without C++ noticing it. Smart pointers are not supported until a workaround for this is implemented.

Passing data by value using value objects solves both issues. They're based on a toJS function on the C++ side and a fromJS function on the JavaScript side. Both receive a callback as an argument, and calling it with any parameters calls the constructor of the equivalent type in the other language.

The callback on the C++ side is of type nbind::cbOutput. Value objects are passed through the C++ stack to and from the exported function. nbind uses C++11 move semantics to avoid creating some additional copies on the way.

The equivalent JavaScript constructor must be registered on the JavaScript side by calling binding.bind('CppClassName', JSClassName) so that nbind knows which types to translate between each other.

Example with a class Coord used as a value object, and a class ObjectExample which uses objects passed by values and references:

5-objects.cc

#include <iostream>

#include "nbind/api.h"

class Coord {

public:

  Coord(signed int x = 0, signed int y = 0) : x(x), y(y) {}
  explicit Coord(const Coord *other) : x(other->x), y(other->y) {}

  void toJS(nbind::cbOutput output) {
    output(x, y);
  }

  signed int getX() { std::cout << "Get X\n"; return(x); }
  signed int getY() { std::cout << "Get Y\n"; return(y); }

  void setX(signed int x) { this->x = x; }
  void setY(signed int y) { this->y = y; }

  signed int x, y;

};

class ObjectExample {

public:

  static void showByValue(Coord coord) {
    std::cout << "C++ value " << coord.x << ", " << coord.y << "\n";
  }

  static void showByRef(Coord *coord) {
    std::cout << "C++ ref " << coord->x << ", " << coord->y << "\n";
  }

  static Coord getValue() {
    return(Coord(12, 34));
  }

  static Coord *getRef() {
    static Coord coord(56, 78);
    return(&coord);
  }

};

#include "nbind/nbind.h"

NBIND_CLASS(Coord) {
  construct<>();
  construct<const Coord *>();
  construct<signed int, signed int>();

  getset(getX, setX);
  getset(getY, setY);
}

NBIND_CLASS(ObjectExample) {
  method(showByValue);
  method(showByRef);
  method(getValue);
  method(getRef);
}

Example used from JavaScript:

5-objects.js

var nbind = require('nbind');

var binding = nbind.init();
var lib = binding.lib;

function Coord(x, y) {
  this.x = x;
  this.y = y;
}

Coord.prototype.fromJS = function(output) {
  output(this.x, this.y);
}

Coord.prototype.show = function() {
  console.log('JS value ' + this.x + ', ' + this.y);
}

binding.bind('Coord', Coord);

var value1 = new Coord(123, 456);
var value2 = lib.ObjectExample.getValue();
var ref = lib.ObjectExample.getRef();

lib.ObjectExample.showByValue(value1);
lib.ObjectExample.showByValue(value2);
value1.show();
value2.show();

lib.ObjectExample.showByRef(ref);
console.log('JS ref ' + ref.x + ', ' + ref.y);

Run the example with node 5-objects.js after installing. It prints:

C++ value 123, 456
C++ value 12, 34
JS value 123, 456
JS value 12, 34
C++ ref 56, 78
Get X
Get Y
JS ref 56, 78

Type conversion

Parameters and return values of function calls between languages are automatically converted between equivalent types:

JavaScript C++
number (un)signed char, short, int, long
number float, double
number or bignum (un)signed long, long long
boolean bool
string const (unsigned) char *
string std::string
Array std::vector<type>
Array std::array<type, size>
Function nbind::cbFunction
(only as a parameter)
See Callbacks
nbind-wrapped pointer Pointer or reference to an
instance of any bound class
See Using objects
Instance of any prototype
(with a fromJS method)
Instance of any bound class
(with a toJS method)
See Using objects
ArrayBuffer(View), Int*Array
or Buffer
nbind::Buffer struct
(data pointer and length)
See Buffers

Type conversion is customizable by passing policies as additional arguments to construct, function or method inside an NBIND_CLASS or NBIND_GLOBAL block. Currently supported policies are:

  • nbind::Nullable() allows passing null as an argument when a C++ class instance is expected. The C++ function will then receive a nullptr.
  • nbind::Strict() enables stricter type checking. Normally anything in JavaScript can be converted to number, string or boolean when expected by a C++ function. This policy requires passing the exact JavaScript type instead.

Type conversion policies are listed after the method or function names, for example:

NBIND_CLASS(Reference) {
    method(reticulateSplines, "reticulate", nbind::Nullable());
    method(printString, nbind::Strict());
}

Buffers

Transferring large chunks of data between languages is fastest using typed arrays or Node.js buffers in JavaScript. Both are accessible from C++ as plain blocks of memory if passed in through the nbind::Buffer data type which has the methods:

  • data() returns an unsigned char * pointing to a block of memory also seen by JavaScript.
  • length() returns the length of the block in bytes.
  • commit() copies data from C++ back to JavaScript (only needed with Emscripten).

This is especially useful for passing canvas.getContext('2d').getImageData(...).data to C++ and drawing to an on-screen bitmap when targeting Emscripten or Electron.

Example:

#include "nbind/api.h"

void range(nbind::Buffer buf) {
  size_t length = buf.length();
  unsigned char *data = buf.data();

  if(!data || !length) return;

  for(size_t pos = 0; pos < length; ++pos) {
    data[pos] = pos;
  }

  buf.commit();
}

#include "nbind/nbind.h"

NBIND_GLOBAL() {
  function(range);
}

Example used from JavaScript:

var nbind = require('nbind');
var lib = nbind.init().lib;

var data = new Uint8Array(16);
lib.range(data);

console.log(data.join(' '));

It prints:

0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15

64-bit integers

Normally C++ 64-bit integer types are first converted to double and then to JavaScript number which can only hold 53 bits of precision, but it's possible to preserve all bits by using a bignum class. It should have a constructor taking the following arguments:

  • Integer containing 32 bits from the least important half.
  • Integer containing 32 bits from the most important half.
  • Boolean, true if the number is negative.

It should also have a fromJS function which takes a callback, and calls it with those same arguments to pass the data back to C++ when needed.

An example implementation also capable of printing 64-bit numbers to strings in bases 2, 4, 10 and 16 is included.

Error handling

You can use the NBIND_ERR("message here"); macro to report an error before returning from C++ (#include "nbind/api.h" first). It will be thrown as an error on the JavaScript side (C++ environments like Emscripten may not support throwing exceptions, but the JavaScript side will).

Publishing on npm

Make sure your package.json file has at least the required emcc-path and install scripts:

  "scripts": {
    "emcc-path": "emcc-path",

    "install": "autogypi && node-gyp configure build"
  }

The dependencies section should have at least:

  "dependencies": {
    "autogypi": "^0.2.2",
	"nbind": "^0.2.1",
    "node-gyp": "^3.3.1"
  }

Your package should also include binding.gyp and autogypi.json files.

Shipping an asm.js fallback

nbind-example-universal is a good minimal example of compiling a native Node.js addon if possible, and otherwise using a pre-compiled asm.js version.

It has two temporary build directories build/native and build/asmjs, for compiling both versions. nbind provides a binary copyasm that can then be used to copy the compiled asm.js library into a nicer location for publishing inside the final npm package.

Note that the native version should be compiled in the install script so it runs for all users of the package, and the asm.js version should be compiled in the prepublish script so it gets packaged in npm for usage without the Emscripten compiler. See the example package.json file.

Using in web browsers

nbind-example-universal is a good minimal example also of calling compiled asm.js code from inside web browsers. The simplest way to get nbind working is to add these scripts in your HTML code as seen in the example index.html:

<script src="nbind.js"></script>

<script>
  nbind.init(function(err, binding) {
    var lib = binding.lib;

    // Use the library.
  });
</script>

Make sure to fix the path to nbind.js on the first line if necessary.

Using with TypeScript

nbind has a fully typed API for interacting with C++ code and it can also automatically generate .d.ts files for your C++ classes and functions. This gives you effortless bindings with compile time type checking for calls from JavaScript to Node.js addons and asm.js modules.

All you have to do is compile your C++ code and run the included ndts tool to create the type definitions:

npm run -- node-gyp configure build
npm run -s -- ndts . > lib-types.d.ts

When run in this way, the first argument of ndts is a path from the package root to the binding.gyp file. Typically the file is in the root so the correct path is .

Now you can load the C++ code from TypeScript in three different ways. First import nbind (which also loads the C++ code) and types generated by ndts:

import * as nbind from 'nbind';
import * as LibTypes from './lib-types';

Then choose your favorite way to initialize it:

Purely synchronous:

const lib = nbind.init<typeof LibTypes>().lib;

// Use the library.

Asynchronous-aware:

nbind.init((err: any, binding: nbind.Binding<typeof LibTypes>) => {
  const lib = binding.lib;

  // Use the library.
});

Promise-based:

import * as bluebird from 'bluebird';

bluebird.promisify(nbind.init)().then((binding: nbind.Binding<typeof LibTypes>) => {
  const lib = binding.lib;

  // Use the library.
});

Note how there is a type argument <typeof LibTypes> for the init call in all of the examples. It defines types of binding.lib contents, which coming from C++ are otherwise unknown to the TypeScript compiler. You can import the types from a file generated by ndts or just use <any> to disable typing.

For example if you have a C++ class:

struct C : public A, public B {
    A *getA();

    static uint32_t reticulate();
};

And bind it like:

NBIND_CLASS(C) {
    inherit(A);
    inherit(B);

    construct<>();

    method(reticulate);

    getter(getA);
}

ndts will generate the following typings:

export interface _C extends A, B {}
export var _C: { new(): _C };

export class C extends _C {
    /** C(); */
    constructor();

    /** static uint32_t reticulate(); */
    static reticulate(): number;

    /** A * a; -- Read-only */
    a: A;
}

The additional interface _C is generated in this case to support multiple inheritance, because C extends both A and B.

All the tests are written in TypeScript so if you run:

git clone https://github.com/charto/nbind.git
cd nbind
npm install
npm test

You can then open test/test.ts in a TypeScript IDE and see the generated typings in action.

Binding plain C

nbind generates bindings using C++ templates for compile-time introspection of argument and return types of functions and methods.

Since plain C doesn't have templates, there's no standard way to have a C compiler generate new wrapper code for type conversion and output type information available at run-time.

The easiest way to use nbind with C is to write a C++ wrapper calling the C code, and use nbind with that.

Mapping idiomatic C to JavaScript classes may require some manual work, since it's common to reinvent new ways to do object-oriented programming, usually by using structs as classes and simulating methods by passing struct pointers to functions. C++ classes and methods should be used for these.

A good example is libui-node which uses nbind to generate bindings for libui, mainly a C library.

Binding external libraries

If you have external library source code, you should compile it separately into a library first, and then link your Node.js addon with it. If the library has an installation script and the addon is only intended for your own use or other users are willing to do some extra steps, it's easiest to install the library globally first.

For best user experience, libui-node is an example of distributing an external library together with your package.

For creating the actual bindings, see for example this and this message and a tutorial for getting the vg library working.

Debugging

In the browser it can be difficult to stop and debug at the correct spot in optimized C++ code. nbind provides an _nbind_debug() function in api.h that you can call from C++ to invoke the browser's debugger when using asm.js.

For debugging a Node.js addon, if you would normally test it like node test.js, you can instead use gdb node and type run test.js in the GDB prompt. Then in case of a crash, it will show where it happened, inspect the stack etc.

You should also modify nbind.gypi (inside nbind's src directory) and possibly your own binding.gyp, to remove any -O? flags and instead add a -g flag, then remove the build directory and recompile. This allows GDB to show much more information.

Alternatives

Very similar:

Less similar:

Authors

  • Juha Järvi, befungedomain

License

The MIT License

Copyright (c) 2014-2017 BusFaster Ltd

Comments
  • using nbind / node-gyp with lot's of extra libraries - how to tell node-gyp where all sources are?

    using nbind / node-gyp with lot's of extra libraries - how to tell node-gyp where all sources are?

    Take a C++ framework, e.g. https://github.com/vgteam/vg/tree/master/src having lots of dependencies when building. Now I would like to e.g. nbind all classes in file https://github.com/vgteam/vg/tree/master/src/vg.cpp. The problem is that when executing "npm run -- node-gyp configure build" the following happens:

    ../src/vg.hpp:11:10: fatal error: 'omp.h' file not found #include <omp.h> ^ 1 error generated.

    This error does not occur if I build the project as specified in the wiki. Following this issue http://stackoverflow.com/questions/25990296/how-to-include-omp-h-in-os-x I have to state that gcc 4.9.3 via homebrew is installed and globally available. Maybe node-gyp does not use gcc / g++? Is there anyway to pass all the source files necessary for the build to node-gyp or how do I proceed here? (I have a CMakeLists.txt file containing over 3000 lines of sources, can I pass this to node-gyp? Or would node-gyp be able to do this automatically?)

    All the best.

    opened by subwaystation 52
  • Multiple native modules failure

    Multiple native modules failure

    I think this issue is similar to #30 (so much that I actually copied the title :p), but the symptoms are a bit different (and quite harder to spot). It seems that if two nbind modules are loaded, the second one will not be correctly binded, and will not convert the binded structures.

    The only workaround I found is to use the asmjs fallbacks.

    [edit] After more tries, it seems it might get worse and we might also get "Type mismatch" errors in some cases. For example, if you do the following:

    $> npm install @manaflair/text-layout
    $> cp -rf node_modules/@manaflair node_modules/@test
    

    Then run this code:

    let TextLayoutA = require(`@manaflair/text-layout`).TextLayout;
    let TextLayoutB = require(`@test/text-layout`).TextLayout;
    
    for (let TextLayout of [ TextLayoutA, TextLayoutB ]) {
    
        let textLayout = new TextLayout();
    
        textLayout.setCharacterGetter(() => `?`);
        textLayout.setCharacterCountGetter(() => 0);
    
        console.assert(textLayout.reset().apply);
    
    }
    

    The execution will fail (instead of passing twice).

    opened by arcanis 22
  • is it possible to create an executable out of created object file?

    is it possible to create an executable out of created object file?

    Hi,

    I am trying to create an executable out of the object file (for instance ../build/Release/obj.target/nbind/cpp/JS_VG.o) in order to perform some debugging with gdb. Replacing "-c" with "-o cpp/JS_AG" in binding.gyp does not do, what I want: cc1plus: fatal error: Release/obj.target/nbind/cpp/JS_AG.d: No such file or directory

    (By the way: Why does it say cc1plus and not g++?)

    I tried doing it manually then:

    g++ -DNODE_GYP_MODULE_NAME=nbind -DUSING_UV_SHARED=1 -DUSING_V8_SHARED=1 -DV8_DEPRECATION_WARNINGS=1 -D_DARWIN_USE_64_BIT_INODE=1 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DBUILDING_NODE_EXTENSION -I/Users/heumos/.node-gyp/7.0.0/include/node -I/Users/heumos/.node-gyp/7.0.0/src -I/Users/heumos/.node-gyp/7.0.0/deps/uv/include -I/Users/heumos/.node-gyp/7.0.0/deps/v8/include -I../node_modules/nan -I../node_modules/nbind/include -Os -gdwarf-2 -mmacosx-version-min=10.11 -arch x86_64 -Wall -Wendif-labels -W -Wno-unused-parameter -std=c++11 -fno-rtti -fno-threadsafe-statics -msse4.1 -fopenmp -frtti -ggdb3 -g -I../../genome-graph/ -I../../genome-graph/include -O3 -std=c++11 -MMD -MF ./Release/.deps/Release/obj.target/nbind/cpp/JS_AG.o.d.raw -o ../cpp/JS_AG.cpp Release/obj.target/nbind/cpp/JS_AG.o
    

    But unsurprisingly the compiler, or to be precise the linker, nags about missing symbols: Undefined symbols for architecture x86_64: Among some symbols missing for vg the symbols for v8 engine are missing, too. How could or would I add them into the command above?

    Just for your information: I put a simple main with 'Hello World'

    Is there any easier way to get my executable?

    opened by subwaystation 21
  • Enumerable properties

    Enumerable properties

    It seems that getters aren't currently enumerable, is it the expected behaviour? Is there a way to make them enumerable? I've tried the following, but got a Type Mismatch error:

    Object.defineProperty(lib.Point.prototype, 'row', {
        enumerable: true
    });
    
    Object.defineProperty(lib.Point.prototype, 'column', {
        enumerable: true
    });
    
    opened by arcanis 12
  • `nbind` fails to throw an Exception for wrong parameter type

    `nbind` fails to throw an Exception for wrong parameter type

    I actually expect this test to pass:

    test('newWindow - throw if width is not a number', t => {
        const err = t.throws(() => new libui.UiWindow('Test window', 'some text', 600, true));
        t.true(err instanceof Error);
    });
    

    because UiWindow constructor expects an int as second argument, but the code is not hrowing any error

    opened by parro-it 12
  • global callback function

    global callback function

    Hi

    Thanks for nbind! I struggle with some callbacks - I want to register a "global" callback (i want to pass events from the app to the js part). As long as the registerLogCallback is active (not returned) the callback works, however when I want to use the callback function at a later time node exit's with the error terminated by signal SIGSEGV (Address boundary error).

    So I assume using a global callback is not very feasible - as the callback function is destroyed after calling it? what's the easiest way to send data from c++ to js without that the js code must request it?

    std::unique_ptr<nbind::cbFunction> callbackFunctionPointer = NULL;
    
    
    void logCallbackTriggeredByAction() {
      ... 
      (*callbackFunctionPointer)("hello2");
    }
    
    void a() {(*callbackFunctionPointer)("from a");}
    
    void registerLogCallback(nbind::cbFunction &callback) {
      callbackFunctionPointer = std::make_unique<nbind::cbFunction>(callback);
      (*callbackFunctionPointer)("hello");
      a();
    }
    
    
    #include "nbind/nbind.h"
    
    NBIND_GLOBAL() {
      function(registerLogCallback);
    }
    
    
    opened by neophob 11
  • long or unsigned long not supported

    long or unsigned long not supported

    I get an error if I use long or unsigned long argument:

    ../node_modules/nbind/include/nbind/v8/ValueObj.h: In instantiation of ‘static nbind::WireType nbind::BindingType<ArgType>::toWireType(ArgType) [with ArgType = long int; nbind::WireType = v8::Local<v8::Value>]’:
    ../node_modules/nbind/include/nbind/v8/Caller.h:76:63:   required from ‘static nbind::WireType nbind::MethodResultConverter<ReturnType>::toWireType(ReturnType&&, Bound&) [with Bound = UiColorButton; ReturnType = long int; nbind::WireType = v8::Local<v8::Value>]’
    ../node_modules/nbind/include/nbind/v8/Caller.h:94:3:   required from ‘static nbind::WireType nbind::Caller<ReturnType, nbind::TypeList<Args ...> >::callMethod(Bound&, MethodType, NanArgs&) [with Bound = UiColorButton; MethodType = long int (UiColorButton::*)(); NanArgs = const Nan::FunctionCallbackInfo<v8::Value>; ReturnType = long int; Args = {}; nbind::WireType = v8::Local<v8::Value>]’
    ../node_modules/nbind/include/nbind/signature/MethodSignature.h:34:3:   required from ‘static void nbind::MethodSignature<PtrType, Bound, ReturnType, Args>::callInner(V8Args&, NanArgs&, Bound*) [with V8Args = const Nan::FunctionCallbackInfo<v8::Value>; NanArgs = const Nan::FunctionCallbackInfo<v8::Value>; PtrType = long int (UiColorButton::*)(); Bound = UiColorButton; ReturnType = long int; Args = {}]’
    ../node_modules/nbind/include/nbind/signature/BaseSignature.h:198:46:   required from ‘static void nbind::TemplatedBaseSignature<Signature, ReturnType, Args>::callInnerSafely(V8Args&, NanArgs&) [with Bound = UiColorButton; V8Args = const Nan::FunctionCallbackInfo<v8::Value>; NanArgs = const Nan::FunctionCallbackInfo<v8::Value>; Signature = nbind::MethodSignature<long int (UiColorButton::*)(), UiColorButton, long int>; ReturnType = long int; Args = {}]’
    ../node_modules/nbind/include/nbind/signature/MethodSignature.h:38:53:   [ skipping 2 instantiation contexts, use -ftemplate-backtrace-limit=0 to disable ]
    ../node_modules/nbind/include/nbind/signature/MethodSignature.h:16:7:   required from ‘static Signature& nbind::TemplatedBaseSignature<Signature, ReturnType, Args>::getInstance() [with Signature = nbind::MethodSignature<long int (UiColorButton::*)(), UiColorButton, long int>; ReturnType = long int; Args = {}]’
    ../node_modules/nbind/include/nbind/BindDefiner.h:77:28:   required from ‘void nbind::BindDefiner<Bound>::addMethod(const char*, MethodType) [with Signature = nbind::MethodSignature<long int (UiColorButton::*)(), UiColorButton, long int>; MethodType = long int (UiColorButton::*)(); Bound = UiColorButton]’
    ../node_modules/nbind/include/nbind/BindDefiner.h:86:12:   required from ‘void nbind::BindDefiner<Bound>::addMethodMaybeConst(const char*, ReturnType (Bound::*)(Args ...)) [with Signature = nbind::MethodSignature; ReturnType = long int; Args = {}; Bound = UiColorButton]’
    ../node_modules/nbind/include/nbind/BindDefiner.h:123:22:   required from ‘nbind::BindDefiner<Bound>& nbind::BindDefiner<Bound>::function(const char*, MethodType, Policies ...) [with MethodType = long int (UiColorButton::*)(); Policies = {}; Bound = UiColorButton]’
    ../src/UiColorButton.cc:45:2:   required from ‘BindInvokerUiColorButton<Bound>::BindInvokerUiColorButton() [with Bound = UiColorButton]’
    ../src/UiColorButton.cc:41:1:   required from here
    ../node_modules/nbind/include/nbind/v8/ValueObj.h:59:3: error: request for member ‘toJS’ in ‘arg’, which is of non-class type ‘long int’
       arg.toJS(construct);
    

    It appear nbind does not recognized as a basic type it and try to implement it as object, requiring a toJS member to convert it.

    I get this while implmenting UiColorButton on libui-node on this branch

    opened by parro-it 10
  • Function overloading works only specifing an alternate JS name for the function

    Function overloading works only specifing an alternate JS name for the function

    We are trying to declare a class with two overloaded fucntions. The functions have following signature:

    void UiAttributedString::appendAttributed(const char *str, UiFontAttribute *attr);
    void UiAttributedString::appendAttributed(const char *str, UiFontAttribute *attr, UiFontAttribute *attr2);
    

    Overloading works well if we specify an alternate name:

    multimethod(appendAttributed, args(const char *, UiFontAttribute *));
    multimethod(appendAttributed, args(const char *, UiFontAttribute *, UiFontAttribute *), "appendAttributed2");
    

    But fails if we remove it, with this error:

    /Users/parroit/repos/libui-node/examples/text.js:40
    str.appendAttributed('underline color',
        ^
    
    Error: Wrong number of arguments, expected 2
        at Object.<anonymous> (/Users/parroit/repos/libui-node/examples/text.js:40:5)
        at Module._compile (module.js:660:30)
        at Object.Module._extensions..js (module.js:671:10)
        at Module.load (module.js:573:32)
        at tryModuleLoad (module.js:513:12)
        at Function.Module._load (module.js:505:3)
        at Function.Module.runMain (module.js:701:10)
        at startup (bootstrap_node.js:190:16)
        at bootstrap_node.js:662:3
    

    Could be we misunderstand how the feature works...

    opened by parro-it 9
  • Transferring a buffer

    Transferring a buffer

    I have the following requirement: On the c++ side I create a buffer with a 32-bit rgba image data (not encoded). On the js side I want to feed this data into a Uint8ClampedArray to be used in a canvas element. currently I return the buffer from c++ as a std::vector<uint8_t>. On the javascript side I get a number[] which I then have to convert to the correct type. These conversions are quite expensive so I was wondering if there was a way to fill a the Uint8ClampedArray directly on the c++ side? Or is this something that will be possible in the future?

    This issue isn't really time critical for me, just want to know if I need to take a different approach.

    opened by TanninOne 9
  • Support node 12

    Support node 12

    This PR updates nbind's codebase to support node 12. The changes are backwards compatible.

    Currently, attempting to build e.g. yoga-layout against node 12 results in various compile errors. The errors are because nbind calls v8 APIs directly rather than using nan APIs, and the v8 apis have changed significantly in node 12.

    opened by shawwn 8
  • Save persistent instances of class pointers.

    Save persistent instances of class pointers.

    I need to save persistent instances of class pointers to avoid them being garbage collected if they are no more referenced by javascript.

    I made some attempt using Persistent handles, but I was unsuccessful. There is an easy way to do this, similar to what we can do with callbacks?

    opened by parro-it 8
  • std::string support is broken

    std::string support is broken

    This code

    class SomeClass {
    	public:
    	std::string SomeString () {
    		return "Hello";
    	}
    };
    
    #include "nbind/nbind.h"
    
    NBIND_CLASS(SomeClass) {
    	method(SomeString);
    }
    

    and then invoking the method from JS fails at runtime with

    Uncaught TypeError: Module.Pointer_stringify is not a function
    

    Pointer_stringify was removed from the emscripten SDK and replaced with UTF8ToString.

    opened by mmarczell-graphisoft 0
  • Is this project dead?

    Is this project dead?

    Is this project abandoned? The last commit was in 2019, last release in 2018. The reason I'm asking is if we decide to use this in our product, and find a bug or a missing feature, are we completely left to our own devices to fix / implement it, or can we hope for help from an author / maintainer?

    opened by mmarczell-graphisoft 0
  • Iterator support?

    Iterator support?

    I'm trying to wrap a class which makes use of C++ iterators, and would like to express this as a Javascript iterator. Is there any way to accomplish this using nbind (I don't think there are any macros for it) either via some manual workarounds directly mixing in NAPI, or via Javascript hacks after the fact?

    opened by borrrden 0
  • Error while dooing fourth step

    Error while dooing fourth step

    I did the fourth step in the readme and I got this error:

    PS C:\Users\ASD\Project\js\node-nana> npm install --save nbind autogypi node-gyp
    npm WARN deprecated [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142
    npm WARN deprecated [email protected]: this library is no longer supported
    npm WARN [email protected] No repository field.
    
    + [email protected]
    + [email protected]
    added 102 packages from 70 contributors, updated 1 package and audited 107 packages in 5.275s
    
    3 packages are looking for funding
      run `npm fund` for details
    
    found 0 vulnerabilities
    
    PS C:\Users\ASD\Project\js\node-nana> npm run -- autogypi --init-gyp -p nbind -s hello.cc
    
    > [email protected] autogypi C:\Users\ASD\Project\js\node-nana
    > autogypi "--init-gyp" "-p" "nbind" "-s" "hello.cc"
    
    PS C:\Users\ASD\Project\js\node-nana> npm run -- autogypi --init-gyp -p nbind -s binding.cpp
    
    > [email protected] autogypi C:\Users\ASD\Project\js\node-nana
    > autogypi "--init-gyp" "-p" "nbind" "-s" "binding.cpp"
    
    PS C:\Users\ASD\Project\js\node-nana> npm run -- autogypi --init-gyp -p nbind -s binding.cpp
    
    > [email protected] autogypi C:\Users\ASD\Project\js\node-nana
    > autogypi "--init-gyp" "-p" "nbind" "-s" "binding.cpp"
    
    
    > [email protected] node-gyp C:\Users\ASD\Project\js\node-nana
    > node-gyp "\"
    
    
    C:\Users\ASD\Project\js\node-nana>if not defined npm_config_node_gyp (node "C:\Users\ASD\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" "\" )  else (node "C:\Users\ASD\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" "\" )
    
      Usage: node-gyp <command> [options]
    
      where <command> is one of:
        - build - Invokes `msbuild` and builds the module
        - clean - Removes any generated build files and the "out" dir
        - configure - Generates MSVC project files for the current module
        - rebuild - Runs "clean", "configure" and "build" all at once
        - install - Install node development files for the specified node version.
        - list - Prints a listing of the currently installed node development files
        - remove - Removes the node development files for the specified version
    
    [email protected]  C:\Users\ASD\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp
    [email protected]
    PS C:\Users\ASD\Project\js\node-nana> npm run -- node-gyp configure build
    
    > [email protected] node-gyp C:\Users\ASD\Project\js\node-nana
    > node-gyp "configure" "build"
    
    
    C:\Users\ASD\Project\js\node-nana>if not defined npm_config_node_gyp (node "C:\Users\ASD\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" "configure" "build" )  else (node "C:\Users\ASD\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" "configure" "build" )
    Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
      Copying node_modules/nbind/src/symbols.txt to Release\obj\nbind\\symbols.txt
              1 file(s) copied.
      binding.cpp
      common.cc
      reflect.cc
      Buffer.cc
      Binding.cc
      win_delay_load_hook.cc
    c:\users\asd\project\js\node-nana\node_modules\nbind\include\nbind\v8/BindWrapper.h(139): error C2039: 'MarkIndepen
    dent': is not a member of 'Nan::Persistent<v8::Object,v8::NonCopyablePersistentTraits<T>>' [C:\Users\ASD\Project\js
    \node-nana\build\nbind.vcxproj]
              with
              [
                  T=v8::Object
              ] (compiling source file ..\node_modules\nbind\src\v8\Binding.cc)c:\users\asd\project\js\node-nana\node_m
      odules\nbind\include\nbind\v8/BindWrapper.h(139): error C2039: 'MarkIndependent': is not a member of 'Nan::Persis
      tent<v8::Object,v8::NonCopyablePersistentTraits<T>>'
              with
              [
                  T=v8::Object
              ] (compiling source file ..\node_modules\nbind\src\common.cc)
    
    c:\users\asd\project\js\node-nana\node_modules\nbind\include\nbind\v8/BindWrapper.h(139): error C2039: 'MarkIndepen
    dent': is not a member of 'Nan::Persistent<v8::Object,v8::NonCopyablePersistentTraits<T>>' [C:\Users\ASD\Project\js
    \node-nana\build\nbind.vcxproj]
              with
              [
                  T=v8::Object
              ] (compiling source file ..\binding.cpp)C:\Users\ASD\Project\js\node-nana\node_modules\nan\nan.h(1988): n
      ote: see declaration of 'Nan::Persistent<v8::Object,v8::NonCopyablePersistentTraits<T>>'
              with
              [
                  T=v8::Object
              ] (compiling source file ..\node_modules\nbind\src\common.cc)C:\Users\ASD\Project\js\node-nana\node_modul
      es\nan\nan.h(1988): note: see declaration of 'Nan::Persistent<v8::Object,v8::NonCopyablePersistentTraits<T>>'
              with
              [
                  T=v8::Object
              ] (compiling source file ..\node_modules\nbind\src\v8\Binding.cc)
    
    
      C:\Users\ASD\Project\js\node-nana\node_modules\nan\nan.h(1988): note: see declaration of 'Nan::Persistent<v8::Obj
      ect,v8::NonCopyablePersistentTraits<T>>'
              with
              [
                  T=v8::Object
              ] (compiling source file ..\binding.cpp)c:\users\asd\project\js\node-nana\node_modules\nbind\include\nbin
      d\v8/BindWrapper.h(139): error C2039: 'MarkIndependent': is not a member of 'Nan::Persistent<v8::Object,v8::NonCo
      pyablePersistentTraits<T>>'
              with
              [
                  T=v8::Object
              ] (compiling source file ..\node_modules\nbind\src\reflect.cc)
    
    c:\users\asd\project\js\node-nana\node_modules\nbind\include\nbind\v8/BindWrapper.h(139): error C2039: 'MarkIndepen
    dent': is not a member of 'Nan::Persistent<v8::Object,v8::NonCopyablePersistentTraits<T>>' [C:\Users\ASD\Project\js
    \node-nana\build\nbind.vcxproj]
              with
              [
                  T=v8::Object
              ] (compiling source file ..\node_modules\nbind\src\v8\Buffer.cc)
      C:\Users\ASD\Project\js\node-nana\node_modules\nan\nan.h(1988): note: see declaration of 'Nan::Persistent<v8::Obj
      ect,v8::NonCopyablePersistentTraits<T>>'
              with
              [
                  T=v8::Object
              ] (compiling source file ..\node_modules\nbind\src\reflect.cc)
      C:\Users\ASD\Project\js\node-nana\node_modules\nan\nan.h(1988): note: see declaration of 'Nan::Persistent<v8::Obj
      ect,v8::NonCopyablePersistentTraits<T>>'
              with
              [
                  T=v8::Object
              ] (compiling source file ..\node_modules\nbind\src\v8\Buffer.cc)
    c:\users\asd\project\js\node-nana\node_modules\nbind\include\nbind\v8/BindingType.h(187): error C2660: 'v8::Value::
    BooleanValue': function does not take 0 arguments (compiling source file ..\node_modules\nbind\src\common.cc) [C:\U
    sers\ASD\Project\js\node-nana\build\nbind.vcxproj]
    c:\users\asd\project\js\node-nana\node_modules\nbind\include\nbind\v8/BindingType.h(187): error C2660: 'v8::Value::
    BooleanValue': function does not take 0 arguments (compiling source file ..\node_modules\nbind\src\v8\Buffer.cc) [C
    :\Users\ASD\Project\js\node-nana\build\nbind.vcxproj]
    c:\users\asd\project\js\node-nana\node_modules\nbind\include\nbind\v8/BindingType.h(187): error C2660: 'v8::Value::
    BooleanValue': function does not take 0 arguments (compiling source file ..\node_modules\nbind\src\reflect.cc) [C:\
    Users\ASD\Project\js\node-nana\build\nbind.vcxproj]
    c:\users\asd\project\js\node-nana\node_modules\nbind\include\nbind\v8/BindingType.h(187): error C2660: 'v8::Value::
    BooleanValue': function does not take 0 arguments (compiling source file ..\binding.cpp) [C:\Users\ASD\Project\js\n
    ode-nana\build\nbind.vcxproj]
    c:\users\asd\project\js\node-nana\node_modules\nbind\include\nbind\v8/BindingType.h(187): error C2660: 'v8::Value::
    BooleanValue': function does not take 0 arguments (compiling source file ..\node_modules\nbind\src\v8\Binding.cc) [
    C:\Users\ASD\Project\js\node-nana\build\nbind.vcxproj]
    c:\users\asd\project\js\node-nana\node_modules\nbind\include\nbind\v8/BindingType.h(189): error C2660: 'v8::Value::
    NumberValue': function does not take 0 arguments (compiling source file ..\node_modules\nbind\src\common.cc) [C:\Us
    ers\ASD\Project\js\node-nana\build\nbind.vcxproj]
    c:\users\asd\project\js\node-nana\node_modules\nbind\include\nbind\v8/BindingType.h(189): error C2660: 'v8::Value::
    NumberValue': function does not take 0 arguments (compiling source file ..\node_modules\nbind\src\v8\Buffer.cc) [C:
    \Users\ASD\Project\js\node-nana\build\nbind.vcxproj]
    c:\users\asd\project\js\node-nana\node_modules\nbind\include\nbind\v8/BindingType.h(189): error C2660: 'v8::Value::
    NumberValue': function does not take 0 arguments (compiling source file ..\node_modules\nbind\src\reflect.cc) [C:\U
    sers\ASD\Project\js\node-nana\build\nbind.vcxproj]
    c:\users\asd\project\js\node-nana\node_modules\nbind\include\nbind\v8/BindingType.h(189): error C2660: 'v8::Value::
    NumberValue': function does not take 0 arguments (compiling source file ..\binding.cpp) [C:\Users\ASD\Project\js\no
    de-nana\build\nbind.vcxproj]
    c:\users\asd\project\js\node-nana\node_modules\nbind\include\nbind\v8/BindingType.h(190): error C2660: 'v8::Value::
    NumberValue': function does not take 0 arguments (compiling source file ..\node_modules\nbind\src\common.cc) [C:\Us
    ers\ASD\Project\js\node-nana\build\nbind.vcxproj]
    c:\users\asd\project\js\node-nana\node_modules\nbind\include\nbind\v8/BindingType.h(190): error C2660: 'v8::Value::
    NumberValue': function does not take 0 arguments (compiling source file ..\node_modules\nbind\src\v8\Buffer.cc) [C:
    \Users\ASD\Project\js\node-nana\build\nbind.vcxproj]
    c:\users\asd\project\js\node-nana\node_modules\nbind\include\nbind\v8/BindingType.h(190): error C2660: 'v8::Value::
    NumberValue': function does not take 0 arguments (compiling source file ..\node_modules\nbind\src\reflect.cc) [C:\U
    sers\ASD\Project\js\node-nana\build\nbind.vcxproj]
    c:\users\asd\project\js\node-nana\node_modules\nbind\include\nbind\v8/BindingType.h(190): error C2660: 'v8::Value::
    NumberValue': function does not take 0 arguments (compiling source file ..\binding.cpp) [C:\Users\ASD\Project\js\no
    de-nana\build\nbind.vcxproj]
    c:\users\asd\project\js\node-nana\node_modules\nbind\include\nbind\v8/BindingType.h(192): error C2660: 'v8::Value::
    Uint32Value': function does not take 0 arguments (compiling source file ..\node_modules\nbind\src\common.cc) [C:\Us
    ers\ASD\Project\js\node-nana\build\nbind.vcxproj]
    c:\users\asd\project\js\node-nana\node_modules\nbind\include\nbind\v8/BindingType.h(192): error C2660: 'v8::Value::
    Uint32Value': function does not take 0 arguments (compiling source file ..\node_modules\nbind\src\v8\Buffer.cc) [C:
    \Users\ASD\Project\js\node-nana\build\nbind.vcxproj]
    c:\users\asd\project\js\node-nana\node_modules\nbind\include\nbind\v8/BindingType.h(192): error C2660: 'v8::Value::
    Uint32Value': function does not take 0 arguments (compiling source file ..\node_modules\nbind\src\reflect.cc) [C:\U
    sers\ASD\Project\js\node-nana\build\nbind.vcxproj]
    c:\users\asd\project\js\node-nana\node_modules\nbind\include\nbind\v8/BindingType.h(189): error C2660: 'v8::Value::
    NumberValue': function does not take 0 arguments (compiling source file ..\node_modules\nbind\src\v8\Binding.cc) [C
    :\Users\ASD\Project\js\node-nana\build\nbind.vcxproj]
    c:\users\asd\project\js\node-nana\node_modules\nbind\include\nbind\v8/BindingType.h(193): error C2660: 'v8::Value::
    Uint32Value': function does not take 0 arguments (compiling source file ..\node_modules\nbind\src\common.cc) [C:\Us
    ers\ASD\Project\js\node-nana\build\nbind.vcxproj]
    c:\users\asd\project\js\node-nana\node_modules\nbind\include\nbind\v8/BindingType.h(193): error C2660: 'v8::Value::
    Uint32Value': function does not take 0 arguments (compiling source file ..\node_modules\nbind\src\v8\Buffer.cc) [C:
    \Users\ASD\Project\js\node-nana\build\nbind.vcxproj]
    c:\users\asd\project\js\node-nana\node_modules\nbind\include\nbind\v8/BindingType.h(193): error C2660: 'v8::Value::
    Uint32Value': function does not take 0 arguments (compiling source file ..\node_modules\nbind\src\reflect.cc) [C:\U
    sers\ASD\Project\js\node-nana\build\nbind.vcxproj]
    c:\users\asd\project\js\node-nana\node_modules\nbind\include\nbind\v8/BindingType.h(194): error C2660: 'v8::Value::
    Uint32Value': function does not take 0 arguments (compiling source file ..\node_modules\nbind\src\common.cc) [C:\Us
    ers\ASD\Project\js\node-nana\build\nbind.vcxproj]
    c:\users\asd\project\js\node-nana\node_modules\nbind\include\nbind\v8/BindingType.h(190): error C2660: 'v8::Value::
    NumberValue': function does not take 0 arguments (compiling source file ..\node_modules\nbind\src\v8\Binding.cc) [C
    :\Users\ASD\Project\js\node-nana\build\nbind.vcxproj]
    c:\users\asd\project\js\node-nana\node_modules\nbind\include\nbind\v8/BindingType.h(194): error C2660: 'v8::Value::
    Uint32Value': function does not take 0 arguments (compiling source file ..\node_modules\nbind\src\v8\Buffer.cc) [C:
    \Users\ASD\Project\js\node-nana\build\nbind.vcxproj]
    c:\users\asd\project\js\node-nana\node_modules\nbind\include\nbind\v8/BindingType.h(194): error C2660: 'v8::Value::
    Uint32Value': function does not take 0 arguments (compiling source file ..\node_modules\nbind\src\reflect.cc) [C:\U
    sers\ASD\Project\js\node-nana\build\nbind.vcxproj]
    c:\users\asd\project\js\node-nana\node_modules\nbind\include\nbind\v8/BindingType.h(192): error C2660: 'v8::Value::
    Uint32Value': function does not take 0 arguments (compiling source file ..\binding.cpp) [C:\Users\ASD\Project\js\no
    de-nana\build\nbind.vcxproj]
    c:\users\asd\project\js\node-nana\node_modules\nbind\include\nbind\v8/BindingType.h(196): error C2660: 'v8::Value::
    Int32Value': function does not take 0 arguments (compiling source file ..\node_modules\nbind\src\common.cc) [C:\Use
    rs\ASD\Project\js\node-nana\build\nbind.vcxproj]
    c:\users\asd\project\js\node-nana\node_modules\nbind\include\nbind\v8/BindingType.h(192): error C2660: 'v8::Value::
    Uint32Value': function does not take 0 arguments (compiling source file ..\node_modules\nbind\src\v8\Binding.cc) [C
    :\Users\ASD\Project\js\node-nana\build\nbind.vcxproj]
    c:\users\asd\project\js\node-nana\node_modules\nbind\include\nbind\v8/BindingType.h(197): error C2660: 'v8::Value::
    Int32Value': function does not take 0 arguments (compiling source file ..\node_modules\nbind\src\common.cc) [C:\Use
    rs\ASD\Project\js\node-nana\build\nbind.vcxproj]
    c:\users\asd\project\js\node-nana\node_modules\nbind\include\nbind\v8/BindingType.h(193): error C2660: 'v8::Value::
    Uint32Value': function does not take 0 arguments (compiling source file ..\binding.cpp) [C:\Users\ASD\Project\js\no
    de-nana\build\nbind.vcxproj]
    c:\users\asd\project\js\node-nana\node_modules\nbind\include\nbind\v8/BindingType.h(193): error C2660: 'v8::Value::
    Uint32Value': function does not take 0 arguments (compiling source file ..\node_modules\nbind\src\v8\Binding.cc) [C
    :\Users\ASD\Project\js\node-nana\build\nbind.vcxproj]
    c:\users\asd\project\js\node-nana\node_modules\nbind\include\nbind\v8/BindingType.h(198): error C2660: 'v8::Value::
    Int32Value': function does not take 0 arguments (compiling source file ..\node_modules\nbind\src\common.cc) [C:\Use
    rs\ASD\Project\js\node-nana\build\nbind.vcxproj]
    c:\users\asd\project\js\node-nana\node_modules\nbind\include\nbind\v8/BindingType.h(194): error C2660: 'v8::Value::
    Uint32Value': function does not take 0 arguments (compiling source file ..\binding.cpp) [C:\Users\ASD\Project\js\no
    de-nana\build\nbind.vcxproj]
    c:\users\asd\project\js\node-nana\node_modules\nbind\include\nbind\v8/BindingType.h(196): error C2660: 'v8::Value::
    Int32Value': function does not take 0 arguments (compiling source file ..\node_modules\nbind\src\v8\Buffer.cc) [C:\
    Users\ASD\Project\js\node-nana\build\nbind.vcxproj]
    c:\users\asd\project\js\node-nana\node_modules\nbind\include\nbind\v8/BindingType.h(194): error C2660: 'v8::Value::
    Uint32Value': function does not take 0 arguments (compiling source file ..\node_modules\nbind\src\v8\Binding.cc) [C
    :\Users\ASD\Project\js\node-nana\build\nbind.vcxproj]
    c:\users\asd\project\js\node-nana\node_modules\nbind\include\nbind\v8/BindingType.h(196): error C2660: 'v8::Value::
    Int32Value': function does not take 0 arguments (compiling source file ..\node_modules\nbind\src\reflect.cc) [C:\Us
    ers\ASD\Project\js\node-nana\build\nbind.vcxproj]
    c:\users\asd\project\js\node-nana\node_modules\nbind\include\nbind\v8/BindingType.h(200): error C2660: 'v8::Value::
    Int32Value': function does not take 0 arguments (compiling source file ..\node_modules\nbind\src\common.cc) [C:\Use
    rs\ASD\Project\js\node-nana\build\nbind.vcxproj]
    c:\users\asd\project\js\node-nana\node_modules\nbind\include\nbind\v8/BindingType.h(196): error C2660: 'v8::Value::
    Int32Value': function does not take 0 arguments (compiling source file ..\binding.cpp) [C:\Users\ASD\Project\js\nod
    e-nana\build\nbind.vcxproj]
    c:\users\asd\project\js\node-nana\node_modules\nbind\include\nbind\v8/BindingType.h(196): error C2660: 'v8::Value::
    Int32Value': function does not take 0 arguments (compiling source file ..\node_modules\nbind\src\v8\Binding.cc) [C:
    \Users\ASD\Project\js\node-nana\build\nbind.vcxproj]
    c:\users\asd\project\js\node-nana\node_modules\nbind\include\nbind\v8/BindingType.h(197): error C2660: 'v8::Value::
    Int32Value': function does not take 0 arguments (compiling source file ..\node_modules\nbind\src\v8\Buffer.cc) [C:\
    Users\ASD\Project\js\node-nana\build\nbind.vcxproj]
    c:\users\asd\project\js\node-nana\node_modules\nbind\include\nbind\v8/BindingType.h(197): error C2660: 'v8::Value::
    Int32Value': function does not take 0 arguments (compiling source file ..\node_modules\nbind\src\reflect.cc) [C:\Us
    ers\ASD\Project\js\node-nana\build\nbind.vcxproj]
    c:\users\asd\project\js\node-nana\node_modules\nbind\include\nbind\v8/BindingType.h(198): error C2660: 'v8::Value::
    Int32Value': function does not take 0 arguments (compiling source file ..\node_modules\nbind\src\v8\Buffer.cc) [C:\
    Users\ASD\Project\js\node-nana\build\nbind.vcxproj]
    c:\users\asd\project\js\node-nana\node_modules\nbind\include\nbind\v8/BindingType.h(198): error C2660: 'v8::Value::
    Int32Value': function does not take 0 arguments (compiling source file ..\node_modules\nbind\src\reflect.cc) [C:\Us
    ers\ASD\Project\js\node-nana\build\nbind.vcxproj]
    c:\users\asd\project\js\node-nana\node_modules\nbind\include\nbind\v8/BindingType.h(197): error C2660: 'v8::Value::
    Int32Value': function does not take 0 arguments (compiling source file ..\node_modules\nbind\src\v8\Binding.cc) [C:
    \Users\ASD\Project\js\node-nana\build\nbind.vcxproj]
    c:\users\asd\project\js\node-nana\node_modules\nbind\include\nbind\v8/BindingType.h(197): error C2660: 'v8::Value::
    Int32Value': function does not take 0 arguments (compiling source file ..\binding.cpp) [C:\Users\ASD\Project\js\nod
    e-nana\build\nbind.vcxproj]
    c:\users\asd\project\js\node-nana\node_modules\nbind\include\nbind\v8/BindingType.h(200): error C2660: 'v8::Value::
    Int32Value': function does not take 0 arguments (compiling source file ..\node_modules\nbind\src\v8\Buffer.cc) [C:\
    Users\ASD\Project\js\node-nana\build\nbind.vcxproj]
    c:\users\asd\project\js\node-nana\node_modules\nbind\include\nbind\v8/BindingType.h(200): error C2660: 'v8::Value::
    Int32Value': function does not take 0 arguments (compiling source file ..\node_modules\nbind\src\reflect.cc) [C:\Us
    ers\ASD\Project\js\node-nana\build\nbind.vcxproj]
    c:\users\asd\project\js\node-nana\node_modules\nbind\include\nbind\v8/BindingType.h(198): error C2660: 'v8::Value::
    Int32Value': function does not take 0 arguments (compiling source file ..\node_modules\nbind\src\v8\Binding.cc) [C:
    \Users\ASD\Project\js\node-nana\build\nbind.vcxproj]
    c:\users\asd\project\js\node-nana\node_modules\nbind\include\nbind\v8/BindingType.h(198): error C2660: 'v8::Value::
    Int32Value': function does not take 0 arguments (compiling source file ..\binding.cpp) [C:\Users\ASD\Project\js\nod
    e-nana\build\nbind.vcxproj]
    c:\users\asd\project\js\node-nana\node_modules\nbind\include\nbind\v8/BindingType.h(200): error C2660: 'v8::Value::
    Int32Value': function does not take 0 arguments (compiling source file ..\node_modules\nbind\src\v8\Binding.cc) [C:
    \Users\ASD\Project\js\node-nana\build\nbind.vcxproj]
    c:\users\asd\project\js\node-nana\node_modules\nbind\include\nbind\v8/BindingType.h(200): error C2660: 'v8::Value::
    Int32Value': function does not take 0 arguments (compiling source file ..\binding.cpp) [C:\Users\ASD\Project\js\nod
    e-nana\build\nbind.vcxproj]
    c:\users\asd\project\js\node-nana\node_modules\nbind\include\nbind\v8/External.h(112): error C2660: 'v8::Value::ToO
    bject': function does not take 0 arguments (compiling source file ..\node_modules\nbind\src\common.cc) [C:\Users\AS
    D\Project\js\node-nana\build\nbind.vcxproj]
    c:\users\asd\project\js\node-nana\node_modules\nbind\include\nbind\v8/BindingStd.h(128): error C2660: 'v8::Value::T
    oString': function does not take 0 arguments (compiling source file ..\node_modules\nbind\src\common.cc) [C:\Users\
    ASD\Project\js\node-nana\build\nbind.vcxproj]
    c:\users\asd\project\js\node-nana\node_modules\nbind\include\nbind\v8/External.h(112): error C2660: 'v8::Value::ToO
    bject': function does not take 0 arguments (compiling source file ..\node_modules\nbind\src\reflect.cc) [C:\Users\A
    SD\Project\js\node-nana\build\nbind.vcxproj]
    c:\users\asd\project\js\node-nana\node_modules\nbind\include\nbind\v8/BindingStd.h(128): error C2512: 'Nan::Utf8Str
    ing::Utf8String': no appropriate default constructor available (compiling source file ..\node_modules\nbind\src\com
    mon.cc) [C:\Users\ASD\Project\js\node-nana\build\nbind.vcxproj]
    c:\users\asd\project\js\node-nana\node_modules\nbind\include\nbind\v8/External.h(112): error C2660: 'v8::Value::ToO
    bject': function does not take 0 arguments (compiling source file ..\node_modules\nbind\src\v8\Buffer.cc) [C:\Users
    \ASD\Project\js\node-nana\build\nbind.vcxproj]
    c:\users\asd\project\js\node-nana\node_modules\nbind\include\nbind\v8/External.h(112): error C2660: 'v8::Value::ToO
    bject': function does not take 0 arguments (compiling source file ..\node_modules\nbind\src\v8\Binding.cc) [C:\User
    s\ASD\Project\js\node-nana\build\nbind.vcxproj]
    c:\users\asd\project\js\node-nana\node_modules\nbind\include\nbind\v8/External.h(112): error C2660: 'v8::Value::ToO
    bject': function does not take 0 arguments (compiling source file ..\binding.cpp) [C:\Users\ASD\Project\js\node-nan
    a\build\nbind.vcxproj]
    c:\users\asd\project\js\node-nana\node_modules\nbind\include\nbind\v8/BindingStd.h(128): error C2660: 'v8::Value::T
    oString': function does not take 0 arguments (compiling source file ..\node_modules\nbind\src\reflect.cc) [C:\Users
    \ASD\Project\js\node-nana\build\nbind.vcxproj]
    c:\users\asd\project\js\node-nana\node_modules\nbind\include\nbind\v8/BindingStd.h(128): error C2660: 'v8::Value::T
    oString': function does not take 0 arguments (compiling source file ..\node_modules\nbind\src\v8\Binding.cc) [C:\Us
    ers\ASD\Project\js\node-nana\build\nbind.vcxproj]
    c:\users\asd\project\js\node-nana\node_modules\nbind\include\nbind\v8/BindingStd.h(128): error C2660: 'v8::Value::T
    oString': function does not take 0 arguments (compiling source file ..\node_modules\nbind\src\v8\Buffer.cc) [C:\Use
    rs\ASD\Project\js\node-nana\build\nbind.vcxproj]
    c:\users\asd\project\js\node-nana\node_modules\nbind\include\nbind\v8/BindingStd.h(128): error C2512: 'Nan::Utf8Str
    ing::Utf8String': no appropriate default constructor available (compiling source file ..\node_modules\nbind\src\ref
    lect.cc) [C:\Users\ASD\Project\js\node-nana\build\nbind.vcxproj]
    c:\users\asd\project\js\node-nana\node_modules\nbind\include\nbind\v8/BindingStd.h(128): error C2512: 'Nan::Utf8Str
    ing::Utf8String': no appropriate default constructor available (compiling source file ..\node_modules\nbind\src\v8\
    Binding.cc) [C:\Users\ASD\Project\js\node-nana\build\nbind.vcxproj]
    c:\users\asd\project\js\node-nana\node_modules\nbind\include\nbind\v8/BindingStd.h(128): error C2512: 'Nan::Utf8Str
    ing::Utf8String': no appropriate default constructor available (compiling source file ..\node_modules\nbind\src\v8\
    Buffer.cc) [C:\Users\ASD\Project\js\node-nana\build\nbind.vcxproj]
    c:\users\asd\project\js\node-nana\node_modules\nbind\include\nbind\v8/BindingStd.h(128): error C2660: 'v8::Value::T
    oString': function does not take 0 arguments (compiling source file ..\binding.cpp) [C:\Users\ASD\Project\js\node-n
    ana\build\nbind.vcxproj]
    c:\users\asd\project\js\node-nana\node_modules\nbind\include\nbind\v8/BindingStd.h(128): error C2512: 'Nan::Utf8Str
    ing::Utf8String': no appropriate default constructor available (compiling source file ..\binding.cpp) [C:\Users\ASD
    \Project\js\node-nana\build\nbind.vcxproj]
    c:\users\asd\project\js\node-nana\node_modules\nbind\include\nbind\v8/Buffer.h(33): error C2660: 'v8::Value::ToObje
    ct': function does not take 0 arguments (compiling source file ..\node_modules\nbind\src\common.cc) [C:\Users\ASD\P
    roject\js\node-nana\build\nbind.vcxproj]
    c:\users\asd\project\js\node-nana\node_modules\nbind\include\nbind\v8/Buffer.h(33): error C2660: 'v8::Value::ToObje
    ct': function does not take 0 arguments (compiling source file ..\node_modules\nbind\src\reflect.cc) [C:\Users\ASD\
    Project\js\node-nana\build\nbind.vcxproj]
    c:\users\asd\project\js\node-nana\node_modules\nbind\include\nbind\v8/Buffer.h(33): error C2660: 'v8::Value::ToObje
    ct': function does not take 0 arguments (compiling source file ..\node_modules\nbind\src\v8\Buffer.cc) [C:\Users\AS
    D\Project\js\node-nana\build\nbind.vcxproj]
    c:\users\asd\project\js\node-nana\node_modules\nbind\include\nbind\v8/Buffer.h(33): error C2660: 'v8::Value::ToObje
    ct': function does not take 0 arguments (compiling source file ..\node_modules\nbind\src\v8\Binding.cc) [C:\Users\A
    SD\Project\js\node-nana\build\nbind.vcxproj]
    c:\users\asd\project\js\node-nana\node_modules\nbind\include\nbind\v8/Buffer.h(33): error C2660: 'v8::Value::ToObje
    ct': function does not take 0 arguments (compiling source file ..\binding.cpp) [C:\Users\ASD\Project\js\node-nana\b
    uild\nbind.vcxproj]
    c:\users\asd\project\js\node-nana\node_modules\nbind\include\nbind\v8/Int64.h(190): error C2660: 'v8::Value::Number
    Value': function does not take 0 arguments (compiling source file ..\node_modules\nbind\src\common.cc) [C:\Users\AS
    D\Project\js\node-nana\build\nbind.vcxproj]
    c:\users\asd\project\js\node-nana\node_modules\nbind\include\nbind\v8/Int64.h(190): error C2660: 'v8::Value::Number
    Value': function does not take 0 arguments (compiling source file ..\node_modules\nbind\src\v8\Binding.cc) [C:\User
    s\ASD\Project\js\node-nana\build\nbind.vcxproj]
    c:\users\asd\project\js\node-nana\node_modules\nbind\include\nbind\v8/Int64.h(190): error C2660: 'v8::Value::Number
    Value': function does not take 0 arguments (compiling source file ..\node_modules\nbind\src\reflect.cc) [C:\Users\A
    SD\Project\js\node-nana\build\nbind.vcxproj]
    c:\users\asd\project\js\node-nana\node_modules\nbind\include\nbind\v8/Int64.h(190): error C2660: 'v8::Value::Number
    Value': function does not take 0 arguments (compiling source file ..\node_modules\nbind\src\v8\Buffer.cc) [C:\Users
    \ASD\Project\js\node-nana\build\nbind.vcxproj]
    c:\users\asd\project\js\node-nana\node_modules\nbind\include\nbind\v8/Int64.h(190): error C2660: 'v8::Value::Number
    Value': function does not take 0 arguments (compiling source file ..\binding.cpp) [C:\Users\ASD\Project\js\node-nan
    a\build\nbind.vcxproj]
    c:\users\asd\project\js\node-nana\node_modules\nbind\include\nbind\v8/Int64.h(191): error C2660: 'v8::Value::Number
    Value': function does not take 0 arguments (compiling source file ..\node_modules\nbind\src\common.cc) [C:\Users\AS
    D\Project\js\node-nana\build\nbind.vcxproj]
    c:\users\asd\project\js\node-nana\node_modules\nbind\include\nbind\v8/Int64.h(191): error C2660: 'v8::Value::Number
    Value': function does not take 0 arguments (compiling source file ..\node_modules\nbind\src\v8\Binding.cc) [C:\User
    s\ASD\Project\js\node-nana\build\nbind.vcxproj]
    c:\users\asd\project\js\node-nana\node_modules\nbind\include\nbind\v8/Int64.h(191): error C2660: 'v8::Value::Number
    Value': function does not take 0 arguments (compiling source file ..\node_modules\nbind\src\reflect.cc) [C:\Users\A
    SD\Project\js\node-nana\build\nbind.vcxproj]
    c:\users\asd\project\js\node-nana\node_modules\nbind\include\nbind\v8/Int64.h(191): error C2660: 'v8::Value::Number
    Value': function does not take 0 arguments (compiling source file ..\node_modules\nbind\src\v8\Buffer.cc) [C:\Users
    \ASD\Project\js\node-nana\build\nbind.vcxproj]
    c:\users\asd\project\js\node-nana\node_modules\nbind\include\nbind\v8/Int64.h(191): error C2660: 'v8::Value::Number
    Value': function does not take 0 arguments (compiling source file ..\binding.cpp) [C:\Users\ASD\Project\js\node-nan
    a\build\nbind.vcxproj]
    c:\users\asd\project\js\node-nana\node_modules\nbind\include\nbind\v8/Int64.h(192): error C2660: 'v8::Value::Number
    Value': function does not take 0 arguments (compiling source file ..\node_modules\nbind\src\common.cc) [C:\Users\AS
    D\Project\js\node-nana\build\nbind.vcxproj]
    c:\users\asd\project\js\node-nana\node_modules\nbind\include\nbind\v8/Int64.h(192): error C2660: 'v8::Value::Number
    Value': function does not take 0 arguments (compiling source file ..\node_modules\nbind\src\v8\Binding.cc) [C:\User
    s\ASD\Project\js\node-nana\build\nbind.vcxproj]
    c:\users\asd\project\js\node-nana\node_modules\nbind\include\nbind\v8/Int64.h(192): error C2660: 'v8::Value::Number
    Value': function does not take 0 arguments (compiling source file ..\node_modules\nbind\src\reflect.cc) [C:\Users\A
    SD\Project\js\node-nana\build\nbind.vcxproj]
    c:\users\asd\project\js\node-nana\node_modules\nbind\include\nbind\v8/Int64.h(192): error C2660: 'v8::Value::Number
    Value': function does not take 0 arguments (compiling source file ..\node_modules\nbind\src\v8\Buffer.cc) [C:\Users
    \ASD\Project\js\node-nana\build\nbind.vcxproj]
    c:\users\asd\project\js\node-nana\node_modules\nbind\include\nbind\v8/Int64.h(192): error C2660: 'v8::Value::Number
    Value': function does not take 0 arguments (compiling source file ..\binding.cpp) [C:\Users\ASD\Project\js\node-nan
    a\build\nbind.vcxproj]
    c:\users\asd\project\js\node-nana\node_modules\nbind\include\nbind\v8/Int64.h(193): error C2660: 'v8::Value::Number
    Value': function does not take 0 arguments (compiling source file ..\node_modules\nbind\src\common.cc) [C:\Users\AS
    D\Project\js\node-nana\build\nbind.vcxproj]
    c:\users\asd\project\js\node-nana\node_modules\nbind\include\nbind\v8/Int64.h(193): error C2660: 'v8::Value::Number
    Value': function does not take 0 arguments (compiling source file ..\node_modules\nbind\src\v8\Binding.cc) [C:\User
    s\ASD\Project\js\node-nana\build\nbind.vcxproj]
    c:\users\asd\project\js\node-nana\node_modules\nbind\include\nbind\v8/Int64.h(193): error C2660: 'v8::Value::Number
    Value': function does not take 0 arguments (compiling source file ..\node_modules\nbind\src\reflect.cc) [C:\Users\A
    SD\Project\js\node-nana\build\nbind.vcxproj]
    c:\users\asd\project\js\node-nana\node_modules\nbind\include\nbind\v8/Int64.h(193): error C2660: 'v8::Value::Number
    Value': function does not take 0 arguments (compiling source file ..\node_modules\nbind\src\v8\Buffer.cc) [C:\Users
    \ASD\Project\js\node-nana\build\nbind.vcxproj]
    c:\users\asd\project\js\node-nana\node_modules\nbind\include\nbind\v8/Int64.h(193): error C2660: 'v8::Value::Number
    Value': function does not take 0 arguments (compiling source file ..\binding.cpp) [C:\Users\ASD\Project\js\node-nan
    a\build\nbind.vcxproj]
    ..\node_modules\nbind\src\v8\Binding.cc(244): error C2065: 'Handle': undeclared identifier [C:\Users\ASD\Project\js
    \node-nana\build\nbind.vcxproj]
    ..\node_modules\nbind\src\v8\Binding.cc(244): error C2275: 'v8::Object': illegal use of this type as an expression
    [C:\Users\ASD\Project\js\node-nana\build\nbind.vcxproj]
      C:\Users\ASD\AppData\Local\node-gyp\Cache\15.6.0\include\node\v8.h(3710): note: see declaration of 'v8::Object'
    ..\node_modules\nbind\src\v8\Binding.cc(244): error C2065: 'exports': undeclared identifier [C:\Users\ASD\Project\j
    s\node-nana\build\nbind.vcxproj]
    ..\node_modules\nbind\src\v8\Binding.cc(244): error C2182: 'initModule': illegal use of type 'void' [C:\Users\ASD\P
    roject\js\node-nana\build\nbind.vcxproj]
    ..\node_modules\nbind\src\v8\Binding.cc(244): error C2448: 'initModule': function-style initializer appears to be a
     function definition [C:\Users\ASD\Project\js\node-nana\build\nbind.vcxproj]
    ..\node_modules\nbind\src\v8\Binding.cc(387): warning C4312: 'type cast': conversion from 'int' to 'node::addon_reg
    ister_func' of greater size [C:\Users\ASD\Project\js\node-nana\build\nbind.vcxproj]
    gyp ERR! build error
    gyp ERR! stack Error: `C:\Program Files (x86)\MSBuild\14.0\bin\MSBuild.                                            .gyp ERR! stack     at ChildProcess.onExit (C:\Users\ASD\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\build.js:194:23)
    gyp ERR! stack     at ChildProcess.emit (node:events:379:20)
    gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:285:12)
    gyp ERR! System Windows_NT 10.0.19042
    gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\ASD\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "configure" "build"
    gyp ERR! cwd C:\Users\ASD\Project\js\node-nana
    gyp ERR! node -v v15.6.0
    gyp ERR! node-gyp -v v5.1.0
    gyp ERR! not ok
    npm ERR! code ELIFECYCLE
    npm ERR! errno 1
    npm ERR! [email protected] node-gyp: `node-gyp "configure" "build"`
    npm ERR! Exit status 1
    npm ERR!
    npm ERR! Failed at the [email protected] node-gyp script.
    npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
    
    npm ERR! A complete log of this run can be found in:
    npm ERR!     C:\Users\ASD\AppData\Roaming\npm-cache\_logs\2021-02-07T03_05_06_201Z-debug.log
    PS C:\Users\ASD\Project\js\node-nana> npm run -- node-gyp configure build
    
    > [email protected] node-gyp C:\Users\ASD\Project\js\node-nananfigure build
    > node-gyp "configure" "build"
    
    
    C:\Users\ASD\Project\js\node-nana>if not defined npm_config_node_gyp (node "C:\Users\ASD\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" "configure" "build" )  else (node "C:\Users\ASD\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" "configure" "build" )
    Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
      binding.cpp
      common.cc
      reflect.cc
      Buffer.cc
      Binding.cc
    c:\users\asd\project\js\node-nana\node_modules\nbind\include\nbind\v8/BindWrapper.h(139): error C2039: 'MarkIndepen
    dent': is not a member of 'Nan::Persistent<v8::Object,v8::NonCopyablePersistentTraits<T>>' [C:\Users\ASD\Project\js
    \node-nana\build\nbind.vcxproj]
              with
              [
                  T=v8::Object
              ] (compiling source file ..\node_modules\nbind\src\v8\Buffer.cc)c:\users\asd\project\js\node-nana\node_mo
      dules\nbind\include\nbind\v8/BindWrapper.h(139): error C2039: 'MarkIndependent': is not a member of 'Nan::Persist
      ent<v8::Object,v8::NonCopyablePersistentTraits<T>>'
              with
              [
                  T=v8::Object
              ] (compiling source file ..\binding.cpp)
    
      cc:\users\asd\project\js\node-nana\node_modules\nbind\include\nbind\v8/BindWrapper.h(139): error C2039: 'MarkInde
      pendent': is not a member of 'Nan::Persistent<v8::Object,v8::NonCopyablePersistentTraits<T>>'
              with
              [
                  T=v8::Object
              ] (compiling source file ..\node_modules\nbind\src\v8\Binding.cc):\users\asd\project\js\node-nana\node_mo
      dules\nbind\include\nbind\v8/BindWrapper.h(139): error C2039: 'MarkIndependent': is not a member of 'Nan::Persist
      ent<v8::Object,v8::NonCopyablePersistentTraits<T>>'
              with
              [
                  T=v8::Object
              ] (compiling source file ..\node_modules\nbind\src\reflect.cc)c:\users\asd\project\js\node-nana\node_modu
      les\nbind\include\nbind\v8/BindWrapper.h(139): error C2039: 'MarkIndependent': is not a member of 'Nan::Persisten
      t<v8::Object,v8::NonCopyablePersistentTraits<T>>'
              with
              [
                  T=v8::Object
              ] (compiling source file ..\node_modules\nbind\src\common.cc)C:\Users\ASD\Project\js\node-nana\node_modul
      es\nan\nan.h(1988): note: see declaration of 'Nan::Persistent<v8::Object,v8::NonCopyablePersistentTraits<T>>'
              with
              [
                  T=v8::Object
              ] (compiling source file ..\node_modules\nbind\src\v8\Buffer.cc)
    
      C:\Users\ASD\Project\js\node-nana\node_modules\nan\nan.h(1988): note: see declaration of 'Nan::Persistent<v8::Obj
      ect,v8::NonCopyablePersistentTraits<T>>'
              with
              [
                  T=v8::Object
              ] (compiling source file ..\binding.cpp)
    
    
      C:\Users\ASD\Project\js\node-nana\node_modules\nan\nan.h(1988): note: see declaration of 'Nan::Persistent<v8::Obj
      ect,v8::NonCopyablePersistentTraits<T>>'
              with
              [
                  T=v8::Object
              ] (compiling source file ..\node_modules\nbind\src\v8\Binding.cc)C:\Users\ASD\Project\js\node-nana\node_m
      odules\nan\nan.h(1988): note: see declaration of 'Nan::Persistent<v8::Object,v8::NonCopyablePersistentTraits<T>>'
              with
              [
                  T=v8::Object
              ] (compiling source file ..\node_modules\nbind\src\common.cc)
    
      C:\Users\ASD\Project\js\node-nana\node_modules\nan\nan.h(1988): note: see declaration of 'Nan::Persistent<v8::Obj
      ect,v8::NonCopyablePersistentTraits<T>>'
              with
              [
                  T=v8::Object
              ] (compiling source file ..\node_modules\nbind\src\reflect.cc)
    c:\users\asd\project\js\node-nana\node_modules\nbind\include\nbind\v8/BindingType.h(187): error C2660: 'v8::Value::
    BooleanValue': function does not take 0 arguments (compiling source file ..\binding.cpp) [C:\Users\ASD\Project\js\n
    ode-nana\build\nbind.vcxproj]
    c:\users\asd\project\js\node-nana\node_modules\nbind\include\nbind\v8/BindingType.h(187): error C2660: 'v8::Value::
    BooleanValue': function does not take 0 arguments (compiling source file ..\node_modules\nbind\src\v8\Buffer.cc) [C
    :\Users\ASD\Project\js\node-nana\build\nbind.vcxproj]
    c:\users\asd\project\js\node-nana\node_modules\nbind\include\nbind\v8/BindingType.h(187): error C2660: 'v8::Value::
    BooleanValue': function does not take 0 arguments (compiling source file ..\node_modules\nbind\src\common.cc) [C:\U
    sers\ASD\Project\js\node-nana\build\nbind.vcxproj]
    c:\users\asd\project\js\node-nana\node_modules\nbind\include\nbind\v8/BindingType.h(187): error C2660: 'v8::Value::
    BooleanValue': function does not take 0 arguments (compiling source file ..\node_modules\nbind\src\reflect.cc) [C:\
    Users\ASD\Project\js\node-nana\build\nbind.vcxproj]
    c:\users\asd\project\js\node-nana\node_modules\nbind\include\nbind\v8/BindingType.h(187): error C2660: 'v8::Value::
    BooleanValue': function does not take 0 arguments (compiling source file ..\node_modules\nbind\src\v8\Binding.cc) [
    C:\Users\ASD\Project\js\node-nana\build\nbind.vcxproj]
    c:\users\asd\project\js\node-nana\node_modules\nbind\include\nbind\v8/BindingType.h(189): error C2660: 'v8::Value::
    NumberValue': function does not take 0 arguments (compiling source file ..\node_modules\nbind\src\v8\Buffer.cc) [C:
    \Users\ASD\Project\js\node-nana\build\nbind.vcxproj]
    c:\users\asd\project\js\node-nana\node_modules\nbind\include\nbind\v8/BindingType.h(189): error C2660: 'v8::Value::
    NumberValue': function does not take 0 arguments (compiling source file ..\binding.cpp) [C:\Users\ASD\Project\js\no
    de-nana\build\nbind.vcxproj]
    c:\users\asd\project\js\node-nana\node_modules\nbind\include\nbind\v8/BindingType.h(189): error C2660: 'v8::Value::
    NumberValue': function does not take 0 arguments (compiling source file ..\node_modules\nbind\src\common.cc) [C:\Us
    ers\ASD\Project\js\node-nana\build\nbind.vcxproj]
    c:\users\asd\project\js\node-nana\node_modules\nbind\include\nbind\v8/BindingType.h(189): error C2660: 'v8::Value::
    NumberValue': function does not take 0 arguments (compiling source file ..\node_modules\nbind\src\reflect.cc) [C:\U
    sers\ASD\Project\js\node-nana\build\nbind.vcxproj]
    c:\users\asd\project\js\node-nana\node_modules\nbind\include\nbind\v8/BindingType.h(190): error C2660: 'v8::Value::
    NumberValue': function does not take 0 arguments (compiling source file ..\node_modules\nbind\src\v8\Buffer.cc) [C:
    \Users\ASD\Project\js\node-nana\build\nbind.vcxproj]
    c:\users\asd\project\js\node-nana\node_modules\nbind\include\nbind\v8/BindingType.h(190): error C2660: 'v8::Value::
    NumberValue': function does not take 0 arguments (compiling source file ..\binding.cpp) [C:\Users\ASD\Project\js\no
    de-nana\build\nbind.vcxproj]
    c:\users\asd\project\js\node-nana\node_modules\nbind\include\nbind\v8/BindingType.h(190): error C2660: 'v8::Value::
    NumberValue': function does not take 0 arguments (compiling source file ..\node_modules\nbind\src\common.cc) [C:\Us
    ers\ASD\Project\js\node-nana\build\nbind.vcxproj]
    c:\users\asd\project\js\node-nana\node_modules\nbind\include\nbind\v8/BindingType.h(192): error C2660: 'v8::Value::
    Uint32Value': function does not take 0 arguments (compiling source file ..\node_modules\nbind\src\v8\Buffer.cc) [C:
    \Users\ASD\Project\js\node-nana\build\nbind.vcxproj]
    c:\users\asd\project\js\node-nana\node_modules\nbind\include\nbind\v8/BindingType.h(190): error C2660: 'v8::Value::
    NumberValue': function does not take 0 arguments (compiling source file ..\node_modules\nbind\src\reflect.cc) [C:\U
    sers\ASD\Project\js\node-nana\build\nbind.vcxproj]
    c:\users\asd\project\js\node-nana\node_modules\nbind\include\nbind\v8/BindingType.h(192): error C2660: 'v8::Value::
    Uint32Value': function does not take 0 arguments (compiling source file ..\node_modules\nbind\src\common.cc) [C:\Us
    ers\ASD\Project\js\node-nana\build\nbind.vcxproj]
    c:\users\asd\project\js\node-nana\node_modules\nbind\include\nbind\v8/BindingType.h(192): error C2660: 'v8::Value::
    Uint32Value': function does not take 0 arguments (compiling source file ..\node_modules\nbind\src\reflect.cc) [C:\U
    sers\ASD\Project\js\node-nana\build\nbind.vcxproj]
    c:\users\asd\project\js\node-nana\node_modules\nbind\include\nbind\v8/BindingType.h(193): error C2660: 'v8::Value::
    Uint32Value': function does not take 0 arguments (compiling source file ..\node_modules\nbind\src\v8\Buffer.cc) [C:
    \Users\ASD\Project\js\node-nana\build\nbind.vcxproj]
    c:\users\asd\project\js\node-nana\node_modules\nbind\include\nbind\v8/BindingType.h(189): error C2660: 'v8::Value::
    NumberValue': function does not take 0 arguments (compiling source file ..\node_modules\nbind\src\v8\Binding.cc) [C
    :\Users\ASD\Project\js\node-nana\build\nbind.vcxproj]
    c:\users\asd\project\js\node-nana\node_modules\nbind\include\nbind\v8/BindingType.h(193): error C2660: 'v8::Value::
    Uint32Value': function does not take 0 arguments (compiling source file ..\node_modules\nbind\src\common.cc) [C:\Us
    ers\ASD\Project\js\node-nana\build\nbind.vcxproj]
    c:\users\asd\project\js\node-nana\node_modules\nbind\include\nbind\v8/BindingType.h(194): error C2660: 'v8::Value::
    Uint32Value': function does not take 0 arguments (compiling source file ..\node_modules\nbind\src\v8\Buffer.cc) [C:
    \Users\ASD\Project\js\node-nana\build\nbind.vcxproj]
    c:\users\asd\project\js\node-nana\node_modules\nbind\include\nbind\v8/BindingType.h(193): error C2660: 'v8::Value::
    Uint32Value': function does not take 0 arguments (compiling source file ..\node_modules\nbind\src\reflect.cc) [C:\U
    sers\ASD\Project\js\node-nana\build\nbind.vcxproj]
    c:\users\asd\project\js\node-nana\node_modules\nbind\include\nbind\v8/BindingType.h(192): error C2660: 'v8::Value::
    Uint32Value': function does not take 0 arguments (compiling source file ..\binding.cpp) [C:\Users\ASD\Project\js\no
    de-nana\build\nbind.vcxproj]
    c:\users\asd\project\js\node-nana\node_modules\nbind\include\nbind\v8/BindingType.h(194): error C2660: 'v8::Value::
    Uint32Value': function does not take 0 arguments (compiling source file ..\node_modules\nbind\src\common.cc) [C:\Us
    ers\ASD\Project\js\node-nana\build\nbind.vcxproj]
    c:\users\asd\project\js\node-nana\node_modules\nbind\include\nbind\v8/BindingType.h(194): error C2660: 'v8::Value::
    Uint32Value': function does not take 0 arguments (compiling source file ..\node_modules\nbind\src\reflect.cc) [C:\U
    sers\ASD\Project\js\node-nana\build\nbind.vcxproj]
    c:\users\asd\project\js\node-nana\node_modules\nbind\include\nbind\v8/BindingType.h(190): error C2660: 'v8::Value::
    NumberValue': function does not take 0 arguments (compiling source file ..\node_modules\nbind\src\v8\Binding.cc) [C
    :\Users\ASD\Project\js\node-nana\build\nbind.vcxproj]
    c:\users\asd\project\js\node-nana\node_modules\nbind\include\nbind\v8/BindingType.h(193): error C2660: 'v8::Value::
    Uint32Value': function does not take 0 arguments (compiling source file ..\binding.cpp) [C:\Users\ASD\Project\js\no
    de-nana\build\nbind.vcxproj]
    c:\users\asd\project\js\node-nana\node_modules\nbind\include\nbind\v8/BindingType.h(192): error C2660: 'v8::Value::
    Uint32Value': function does not take 0 arguments (compiling source file ..\node_modules\nbind\src\v8\Binding.cc) [C
    :\Users\ASD\Project\js\node-nana\build\nbind.vcxproj]
    c:\users\asd\project\js\node-nana\node_modules\nbind\include\nbind\v8/BindingType.h(194): error C2660: 'v8::Value::
    Uint32Value': function does not take 0 arguments (compiling source file ..\binding.cpp) [C:\Users\ASD\Project\js\no
    de-nana\build\nbind.vcxproj]
    c:\users\asd\project\js\node-nana\node_modules\nbind\include\nbind\v8/BindingType.h(196): error C2660: 'v8::Value::
    Int32Value': function does not take 0 arguments (compiling source file ..\node_modules\nbind\src\v8\Buffer.cc) [C:\
    Users\ASD\Project\js\node-nana\build\nbind.vcxproj]
    c:\users\asd\project\js\node-nana\node_modules\nbind\include\nbind\v8/BindingType.h(196): error C2660: 'v8::Value::
    Int32Value': function does not take 0 arguments (compiling source file ..\node_modules\nbind\src\common.cc) [C:\Use
    rs\ASD\Project\js\node-nana\build\nbind.vcxproj]
    c:\users\asd\project\js\node-nana\node_modules\nbind\include\nbind\v8/BindingType.h(196): error C2660: 'v8::Value::
    Int32Value': function does not take 0 arguments (compiling source file ..\node_modules\nbind\src\reflect.cc) [C:\Us
    ers\ASD\Project\js\node-nana\build\nbind.vcxproj]
    c:\users\asd\project\js\node-nana\node_modules\nbind\include\nbind\v8/BindingType.h(196): error C2660: 'v8::Value::
    Int32Value': function does not take 0 arguments (compiling source file ..\binding.cpp) [C:\Users\ASD\Project\js\nod
    e-nana\build\nbind.vcxproj]
    c:\users\asd\project\js\node-nana\node_modules\nbind\include\nbind\v8/BindingType.h(193): error C2660: 'v8::Value::
    Uint32Value': function does not take 0 arguments (compiling source file ..\node_modules\nbind\src\v8\Binding.cc) [C
    :\Users\ASD\Project\js\node-nana\build\nbind.vcxproj]
    c:\users\asd\project\js\node-nana\node_modules\nbind\include\nbind\v8/BindingType.h(197): error C2660: 'v8::Value::
    Int32Value': function does not take 0 arguments (compiling source file ..\node_modules\nbind\src\v8\Buffer.cc) [C:\
    Users\ASD\Project\js\node-nana\build\nbind.vcxproj]
    c:\users\asd\project\js\node-nana\node_modules\nbind\include\nbind\v8/BindingType.h(197): error C2660: 'v8::Value::
    Int32Value': function does not take 0 arguments (compiling source file ..\node_modules\nbind\src\common.cc) [C:\Use
    rs\ASD\Project\js\node-nana\build\nbind.vcxproj]
    c:\users\asd\project\js\node-nana\node_modules\nbind\include\nbind\v8/BindingType.h(194): error C2660: 'v8::Value::
    Uint32Value': function does not take 0 arguments (compiling source file ..\node_modules\nbind\src\v8\Binding.cc) [C
    :\Users\ASD\Project\js\node-nana\build\nbind.vcxproj]
    c:\users\asd\project\js\node-nana\node_modules\nbind\include\nbind\v8/BindingType.h(198): error C2660: 'v8::Value::
    Int32Value': function does not take 0 arguments (compiling source file ..\node_modules\nbind\src\v8\Buffer.cc) [C:\
    Users\ASD\Project\js\node-nana\build\nbind.vcxproj]
    c:\users\asd\project\js\node-nana\node_modules\nbind\include\nbind\v8/BindingType.h(197): error C2660: 'v8::Value::
    Int32Value': function does not take 0 arguments (compiling source file ..\node_modules\nbind\src\reflect.cc) [C:\Us
    ers\ASD\Project\js\node-nana\build\nbind.vcxproj]
    c:\users\asd\project\js\node-nana\node_modules\nbind\include\nbind\v8/BindingType.h(197): error C2660: 'v8::Value::
    Int32Value': function does not take 0 arguments (compiling source file ..\binding.cpp) [C:\Users\ASD\Project\js\nod
    e-nana\build\nbind.vcxproj]
    c:\users\asd\project\js\node-nana\node_modules\nbind\include\nbind\v8/BindingType.h(198): error C2660: 'v8::Value::
    Int32Value': function does not take 0 arguments (compiling source file ..\node_modules\nbind\src\common.cc) [C:\Use
    rs\ASD\Project\js\node-nana\build\nbind.vcxproj]
    c:\users\asd\project\js\node-nana\node_modules\nbind\include\nbind\v8/BindingType.h(196): error C2660: 'v8::Value::
    Int32Value': function does not take 0 arguments (compiling source file ..\node_modules\nbind\src\v8\Binding.cc) [C:
    \Users\ASD\Project\js\node-nana\build\nbind.vcxproj]
    c:\users\asd\project\js\node-nana\node_modules\nbind\include\nbind\v8/BindingType.h(200): error C2660: 'v8::Value::
    Int32Value': function does not take 0 arguments (compiling source file ..\node_modules\nbind\src\v8\Buffer.cc) [C:\
    Users\ASD\Project\js\node-nana\build\nbind.vcxproj]
    c:\users\asd\project\js\node-nana\node_modules\nbind\include\nbind\v8/BindingType.h(198): error C2660: 'v8::Value::
    Int32Value': function does not take 0 arguments (compiling source file ..\node_modules\nbind\src\reflect.cc) [C:\Us
    ers\ASD\Project\js\node-nana\build\nbind.vcxproj]
    c:\users\asd\project\js\node-nana\node_modules\nbind\include\nbind\v8/BindingType.h(198): error C2660: 'v8::Value::
    Int32Value': function does not take 0 arguments (compiling source file ..\binding.cpp) [C:\Users\ASD\Project\js\nod
    e-nana\build\nbind.vcxproj]
    c:\users\asd\project\js\node-nana\node_modules\nbind\include\nbind\v8/BindingType.h(200): error C2660: 'v8::Value::
    Int32Value': function does not take 0 arguments (compiling source file ..\node_modules\nbind\src\common.cc) [C:\Use
    rs\ASD\Project\js\node-nana\build\nbind.vcxproj]
    c:\users\asd\project\js\node-nana\node_modules\nbind\include\nbind\v8/BindingType.h(200): error C2660: 'v8::Value::
    Int32Value': function does not take 0 arguments (compiling source file ..\node_modules\nbind\src\reflect.cc) [C:\Us
    ers\ASD\Project\js\node-nana\build\nbind.vcxproj]
    c:\users\asd\project\js\node-nana\node_modules\nbind\include\nbind\v8/BindingType.h(200): error C2660: 'v8::Value::
    Int32Value': function does not take 0 arguments (compiling source file ..\binding.cpp) [C:\Users\ASD\Project\js\nod
    e-nana\build\nbind.vcxproj]
    c:\users\asd\project\js\node-nana\node_modules\nbind\include\nbind\v8/BindingType.h(197): error C2660: 'v8::Value::
    Int32Value': function does not take 0 arguments (compiling source file ..\node_modules\nbind\src\v8\Binding.cc) [C:
    \Users\ASD\Project\js\node-nana\build\nbind.vcxproj]
    c:\users\asd\project\js\node-nana\node_modules\nbind\include\nbind\v8/BindingType.h(198): error C2660: 'v8::Value::
    Int32Value': function does not take 0 arguments (compiling source file ..\node_modules\nbind\src\v8\Binding.cc) [C:
    \Users\ASD\Project\js\node-nana\build\nbind.vcxproj]
    c:\users\asd\project\js\node-nana\node_modules\nbind\include\nbind\v8/BindingType.h(200): error C2660: 'v8::Value::
    Int32Value': function does not take 0 arguments (compiling source file ..\node_modules\nbind\src\v8\Binding.cc) [C:
    \Users\ASD\Project\js\node-nana\build\nbind.vcxproj]
    c:\users\asd\project\js\node-nana\node_modules\nbind\include\nbind\v8/External.h(112): error C2660: 'v8::Value::ToO
    bject': function does not take 0 arguments (compiling source file ..\node_modules\nbind\src\common.cc) [C:\Users\AS
    D\Project\js\node-nana\build\nbind.vcxproj]
    c:\users\asd\project\js\node-nana\node_modules\nbind\include\nbind\v8/External.h(112): error C2660: 'v8::Value::ToO
    bject': function does not take 0 arguments (compiling source file ..\node_modules\nbind\src\v8\Buffer.cc) [C:\Users
    \ASD\Project\js\node-nana\build\nbind.vcxproj]
    c:\users\asd\project\js\node-nana\node_modules\nbind\include\nbind\v8/External.h(112): error C2660: 'v8::Value::ToO
    bject': function does not take 0 arguments (compiling source file ..\node_modules\nbind\src\reflect.cc) [C:\Users\A
    SD\Project\js\node-nana\build\nbind.vcxproj]
    c:\users\asd\project\js\node-nana\node_modules\nbind\include\nbind\v8/External.h(112): error C2660: 'v8::Value::ToO
    bject': function does not take 0 arguments (compiling source file ..\binding.cpp) [C:\Users\ASD\Project\js\node-nan
    a\build\nbind.vcxproj]
    c:\users\asd\project\js\node-nana\node_modules\nbind\include\nbind\v8/BindingStd.h(128): error C2660: 'v8::Value::T
    oString': function does not take 0 arguments (compiling source file ..\node_modules\nbind\src\common.cc) [C:\Users\
    ASD\Project\js\node-nana\build\nbind.vcxproj]
    c:\users\asd\project\js\node-nana\node_modules\nbind\include\nbind\v8/BindingStd.h(128): error C2512: 'Nan::Utf8Str
    ing::Utf8String': no appropriate default constructor available (compiling source file ..\node_modules\nbind\src\com
    mon.cc) [C:\Users\ASD\Project\js\node-nana\build\nbind.vcxproj]
    c:\users\asd\project\js\node-nana\node_modules\nbind\include\nbind\v8/BindingStd.h(128): error C2660: 'v8::Value::T
    oString': function does not take 0 arguments (compiling source file ..\node_modules\nbind\src\v8\Buffer.cc) [C:\Use
    rs\ASD\Project\js\node-nana\build\nbind.vcxproj]
    c:\users\asd\project\js\node-nana\node_modules\nbind\include\nbind\v8/BindingStd.h(128): error C2660: 'v8::Value::T
    oString': function does not take 0 arguments (compiling source file ..\node_modules\nbind\src\reflect.cc) [C:\Users
    \ASD\Project\js\node-nana\build\nbind.vcxproj]
    c:\users\asd\project\js\node-nana\node_modules\nbind\include\nbind\v8/BindingStd.h(128): error C2512: 'Nan::Utf8Str
    ing::Utf8String': no appropriate default constructor available (compiling source file ..\node_modules\nbind\src\v8\
    Buffer.cc) [C:\Users\ASD\Project\js\node-nana\build\nbind.vcxproj]
    c:\users\asd\project\js\node-nana\node_modules\nbind\include\nbind\v8/BindingStd.h(128): error C2512: 'Nan::Utf8Str
    ing::Utf8String': no appropriate default constructor available (compiling source file ..\node_modules\nbind\src\ref
    lect.cc) [C:\Users\ASD\Project\js\node-nana\build\nbind.vcxproj]
    c:\users\asd\project\js\node-nana\node_modules\nbind\include\nbind\v8/BindingStd.h(128): error C2660: 'v8::Value::T
    oString': function does not take 0 arguments (compiling source file ..\binding.cpp) [C:\Users\ASD\Project\js\node-n
    ana\build\nbind.vcxproj]
    c:\users\asd\project\js\node-nana\node_modules\nbind\include\nbind\v8/BindingStd.h(128): error C2512: 'Nan::Utf8Str
    ing::Utf8String': no appropriate default constructor available (compiling source file ..\binding.cpp) [C:\Users\ASD
    \Project\js\node-nana\build\nbind.vcxproj]
    c:\users\asd\project\js\node-nana\node_modules\nbind\include\nbind\v8/External.h(112): error C2660: 'v8::Value::ToO
    bject': function does not take 0 arguments (compiling source file ..\node_modules\nbind\src\v8\Binding.cc) [C:\User
    s\ASD\Project\js\node-nana\build\nbind.vcxproj]
    c:\users\asd\project\js\node-nana\node_modules\nbind\include\nbind\v8/Buffer.h(33): error C2660: 'v8::Value::ToObje
    ct': function does not take 0 arguments (compiling source file ..\node_modules\nbind\src\reflect.cc) [C:\Users\ASD\
    Project\js\node-nana\build\nbind.vcxproj]
    c:\users\asd\project\js\node-nana\node_modules\nbind\include\nbind\v8/Buffer.h(33): error C2660: 'v8::Value::ToObje
    ct': function does not take 0 arguments (compiling source file ..\node_modules\nbind\src\v8\Buffer.cc) [C:\Users\AS
    D\Project\js\node-nana\build\nbind.vcxproj]
    c:\users\asd\project\js\node-nana\node_modules\nbind\include\nbind\v8/Buffer.h(33): error C2660: 'v8::Value::ToObje
    ct': function does not take 0 arguments (compiling source file ..\binding.cpp) [C:\Users\ASD\Project\js\node-nana\b
    uild\nbind.vcxproj]
    c:\users\asd\project\js\node-nana\node_modules\nbind\include\nbind\v8/Buffer.h(33): error C2660: 'v8::Value::ToObje
    ct': function does not take 0 arguments (compiling source file ..\node_modules\nbind\src\common.cc) [C:\Users\ASD\P
    roject\js\node-nana\build\nbind.vcxproj]
    c:\users\asd\project\js\node-nana\node_modules\nbind\include\nbind\v8/BindingStd.h(128): error C2660: 'v8::Value::T
    oString': function does not take 0 arguments (compiling source file ..\node_modules\nbind\src\v8\Binding.cc) [C:\Us
    ers\ASD\Project\js\node-nana\build\nbind.vcxproj]
    c:\users\asd\project\js\node-nana\node_modules\nbind\include\nbind\v8/BindingStd.h(128): error C2512: 'Nan::Utf8Str
    ing::Utf8String': no appropriate default constructor available (compiling source file ..\node_modules\nbind\src\v8\
    Binding.cc) [C:\Users\ASD\Project\js\node-nana\build\nbind.vcxproj]
    c:\users\asd\project\js\node-nana\node_modules\nbind\include\nbind\v8/Buffer.h(33): error C2660: 'v8::Value::ToObje
    ct': function does not take 0 arguments (compiling source file ..\node_modules\nbind\src\v8\Binding.cc) [C:\Users\A
    SD\Project\js\node-nana\build\nbind.vcxproj]
    c:\users\asd\project\js\node-nana\node_modules\nbind\include\nbind\v8/Int64.h(190): error C2660: 'v8::Value::Number
    Value': function does not take 0 arguments (compiling source file ..\node_modules\nbind\src\v8\Buffer.cc) [C:\Users
    \ASD\Project\js\node-nana\build\nbind.vcxproj]
    c:\users\asd\project\js\node-nana\node_modules\nbind\include\nbind\v8/Int64.h(190): error C2660: 'v8::Value::Number
    Value': function does not take 0 arguments (compiling source file ..\node_modules\nbind\src\common.cc) [C:\Users\AS
    D\Project\js\node-nana\build\nbind.vcxproj]
    c:\users\asd\project\js\node-nana\node_modules\nbind\include\nbind\v8/Int64.h(190): error C2660: 'v8::Value::Number
    Value': function does not take 0 arguments (compiling source file ..\binding.cpp) [C:\Users\ASD\Project\js\node-nan
    a\build\nbind.vcxproj]
    c:\users\asd\project\js\node-nana\node_modules\nbind\include\nbind\v8/Int64.h(190): error C2660: 'v8::Value::Number
    Value': function does not take 0 arguments (compiling source file ..\node_modules\nbind\src\reflect.cc) [C:\Users\A
    SD\Project\js\node-nana\build\nbind.vcxproj]
    c:\users\asd\project\js\node-nana\node_modules\nbind\include\nbind\v8/Int64.h(190): error C2660: 'v8::Value::Number
    Value': function does not take 0 arguments (compiling source file ..\node_modules\nbind\src\v8\Binding.cc) [C:\User
    s\ASD\Project\js\node-nana\build\nbind.vcxproj]
    c:\users\asd\project\js\node-nana\node_modules\nbind\include\nbind\v8/Int64.h(191): error C2660: 'v8::Value::Number
    Value': function does not take 0 arguments (compiling source file ..\node_modules\nbind\src\v8\Buffer.cc) [C:\Users
    \ASD\Project\js\node-nana\build\nbind.vcxproj]
    c:\users\asd\project\js\node-nana\node_modules\nbind\include\nbind\v8/Int64.h(191): error C2660: 'v8::Value::Number
    Value': function does not take 0 arguments (compiling source file ..\node_modules\nbind\src\common.cc) [C:\Users\AS
    D\Project\js\node-nana\build\nbind.vcxproj]
    c:\users\asd\project\js\node-nana\node_modules\nbind\include\nbind\v8/Int64.h(191): error C2660: 'v8::Value::Number
    Value': function does not take 0 arguments (compiling source file ..\binding.cpp) [C:\Users\ASD\Project\js\node-nan
    a\build\nbind.vcxproj]
    c:\users\asd\project\js\node-nana\node_modules\nbind\include\nbind\v8/Int64.h(191): error C2660: 'v8::Value::Number
    Value': function does not take 0 arguments (compiling source file ..\node_modules\nbind\src\reflect.cc) [C:\Users\A
    SD\Project\js\node-nana\build\nbind.vcxproj]
    c:\users\asd\project\js\node-nana\node_modules\nbind\include\nbind\v8/Int64.h(191): error C2660: 'v8::Value::Number
    Value': function does not take 0 arguments (compiling source file ..\node_modules\nbind\src\v8\Binding.cc) [C:\User
    s\ASD\Project\js\node-nana\build\nbind.vcxproj]
    c:\users\asd\project\js\node-nana\node_modules\nbind\include\nbind\v8/Int64.h(192): error C2660: 'v8::Value::Number
    Value': function does not take 0 arguments (compiling source file ..\node_modules\nbind\src\common.cc) [C:\Users\AS
    D\Project\js\node-nana\build\nbind.vcxproj]
    c:\users\asd\project\js\node-nana\node_modules\nbind\include\nbind\v8/Int64.h(192): error C2660: 'v8::Value::Number
    Value': function does not take 0 arguments (compiling source file ..\node_modules\nbind\src\v8\Buffer.cc) [C:\Users
    \ASD\Project\js\node-nana\build\nbind.vcxproj]
    c:\users\asd\project\js\node-nana\node_modules\nbind\include\nbind\v8/Int64.h(192): error C2660: 'v8::Value::Number
    Value': function does not take 0 arguments (compiling source file ..\binding.cpp) [C:\Users\ASD\Project\js\node-nan
    a\build\nbind.vcxproj]
    c:\users\asd\project\js\node-nana\node_modules\nbind\include\nbind\v8/Int64.h(192): error C2660: 'v8::Value::Number
    Value': function does not take 0 arguments (compiling source file ..\node_modules\nbind\src\reflect.cc) [C:\Users\A
    SD\Project\js\node-nana\build\nbind.vcxproj]
    c:\users\asd\project\js\node-nana\node_modules\nbind\include\nbind\v8/Int64.h(192): error C2660: 'v8::Value::Number
    Value': function does not take 0 arguments (compiling source file ..\node_modules\nbind\src\v8\Binding.cc) [C:\User
    s\ASD\Project\js\node-nana\build\nbind.vcxproj]
    c:\users\asd\project\js\node-nana\node_modules\nbind\include\nbind\v8/Int64.h(193): error C2660: 'v8::Value::Number
    Value': function does not take 0 arguments (compiling source file ..\node_modules\nbind\src\common.cc) [C:\Users\AS
    D\Project\js\node-nana\build\nbind.vcxproj]
    c:\users\asd\project\js\node-nana\node_modules\nbind\include\nbind\v8/Int64.h(193): error C2660: 'v8::Value::Number
    Value': function does not take 0 arguments (compiling source file ..\node_modules\nbind\src\v8\Buffer.cc) [C:\Users
    \ASD\Project\js\node-nana\build\nbind.vcxproj]
    c:\users\asd\project\js\node-nana\node_modules\nbind\include\nbind\v8/Int64.h(193): error C2660: 'v8::Value::Number
    Value': function does not take 0 arguments (compiling source file ..\binding.cpp) [C:\Users\ASD\Project\js\node-nan
    a\build\nbind.vcxproj]
    c:\users\asd\project\js\node-nana\node_modules\nbind\include\nbind\v8/Int64.h(193): error C2660: 'v8::Value::Number
    Value': function does not take 0 arguments (compiling source file ..\node_modules\nbind\src\reflect.cc) [C:\Users\A
    SD\Project\js\node-nana\build\nbind.vcxproj]
    c:\users\asd\project\js\node-nana\node_modules\nbind\include\nbind\v8/Int64.h(193): error C2660: 'v8::Value::Number
    Value': function does not take 0 arguments (compiling source file ..\node_modules\nbind\src\v8\Binding.cc) [C:\User
    s\ASD\Project\js\node-nana\build\nbind.vcxproj]
    ..\node_modules\nbind\src\v8\Binding.cc(244): error C2065: 'Handle': undeclared identifier [C:\Users\ASD\Project\js
    \node-nana\build\nbind.vcxproj]
    ..\node_modules\nbind\src\v8\Binding.cc(244): error C2275: 'v8::Object': illegal use of this type as an expression
    [C:\Users\ASD\Project\js\node-nana\build\nbind.vcxproj]
      C:\Users\ASD\AppData\Local\node-gyp\Cache\15.6.0\include\node\v8.h(3710): note: see declaration of 'v8::Object'
    ..\node_modules\nbind\src\v8\Binding.cc(244): error C2065: 'exports': undeclared identifier [C:\Users\ASD\Project\j
    s\node-nana\build\nbind.vcxproj]
    ..\node_modules\nbind\src\v8\Binding.cc(244): error C2182: 'initModule': illegal use of type 'void' [C:\Users\ASD\P
    roject\js\node-nana\build\nbind.vcxproj]
    ..\node_modules\nbind\src\v8\Binding.cc(244): error C2448: 'initModule': function-style initializer appears to be a
     function definition [C:\Users\ASD\Project\js\node-nana\build\nbind.vcxproj]
    ..\node_modules\nbind\src\v8\Binding.cc(387): warning C4312: 'type cast': conversion from 'int' to 'node::addon_reg
    ister_func' of greater size [C:\Users\ASD\Project\js\node-nana\build\nbind.vcxproj]
    gyp ERR! build error
    gyp ERR! stack Error: `C:\Program Files (x86)\MSBuild\14.0\bin\MSBuild.                                            .exe` failed with exit code: 1
    gyp ERR! stack     at ChildProcess.onExit (C:\Users\ASD\AppData\Roaming                                            g\npm\node_modules\npm\node_modules\node-gyp\lib\build.js:194:23)
    gyp ERR! stack     at ChildProcess.emit (node:events:379:20)
    gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:interna                                            al/child_process:285:12)
    gyp ERR! System Windows_NT 10.0.19042
    gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\ASD\                                            \\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "configure" "build"
    gyp ERR! cwd C:\Users\ASD\Project\js\node-nana
    gyp ERR! node -v v15.6.0
    gyp ERR! node-gyp -v v5.1.0
    gyp ERR! not ok
    npm ERR! code ELIFECYCLE
    npm ERR! errno 1
    npm ERR! [email protected] node-gyp: `node-gyp "configure" "build"`
    npm ERR! Exit status 1
    npm ERR!
    npm ERR! Failed at the [email protected] node-gyp script.
    npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
    
    npm ERR! A complete log of this run can be found in:
    npm ERR!     C:\Users\ASD\AppData\Roaming\npm-cache\_logs\2021-02-07T03_13_25_252Z-debug.log
    

    I am on windows and I use msvc as compiler

    opened by PissMan420 5
  • npm i produces error

    npm i produces error "type-check is deprecated" and "Type 'string' cannot be used to index type 'ExportType'."

    After cloning, while npm installling, nbinid will produce the following errors with the following node/npm versions:

    ➜  nbind git:(master) ✗ node -v
    v12.18.4
    ➜  nbind git:(master) ✗ npm -v
    6.14.6
    ➜  nbind git:(master) npm i
    ....
    > [email protected] lint /Users/rosenbek/github/nbind
    > node src/checkver.js lt 10.0.0 || (tslint --type-check -c src/tslint.json -p src/tsconfig.json && tslint --type-check -c src/tslint.json -p src/em/tsconfig.json)
    
    --type-check is deprecated. You only need --project to enable rules which need type information.
    Error at src/nbind.ts:329:3: Type 'string' cannot be used to index type 'ExportType'.
    

    I removed the --type-check flags from the package.json, which got me further, but then I get a new error:

    ➜  nbind git:(master) ✗ npm i 
    ...
    
    > [email protected] lint /Users/rosenbek/github/nbind
    > node src/checkver.js lt 10.0.0 || (tslint -c src/tslint.json -p src/tsconfig.json && tslint -c src/tslint.json -p src/em/tsconfig.json)
    
    src/nbind.ts:329:3 - error TS2536: Type 'string' cannot be used to index type 'ExportType'.
    
    329  	binding.lib[key] = lib[key];
         	~~~~~~~~~~~~~~~~
    
    
    Found 1 error.
    

    Which seems to come from this code:

    	Object.keys(lib).forEach(function(key: string) {
    		binding.lib[key] = lib[key];
    	});
    

    because key is a string, but binding.lib is expecting this ExportType object. I did try to fix this and hope to put together a PR, but I am a bit too new to nbind I think to produce a valid solution.

    opened by netpoetica 0
  • sample app refuses to run

    sample app refuses to run

    Hello and thanks for your great work!

    I am trying to build turbo vision TUI framework binding for node with nbind. Followed the vg instruction and finally got my build done. But js code fails with the following error:

    $ ./test.js
    internal/modules/cjs/loader.js:807
      return process.dlopen(module, path.toNamespacedPath(filename));
                     ^
    
    Error: /home/unxed/far2l/!!next/!!node-cli/nbind/git/project/build/Release/nbind.node: undefined symbol: _ZN8TProgram7deskTopE
        at Object.Module._extensions..node (internal/modules/cjs/loader.js:807:18)
        at Module.load (internal/modules/cjs/loader.js:653:32)
        at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
        at Function.Module._load (internal/modules/cjs/loader.js:585:3)
        at Module.require (internal/modules/cjs/loader.js:692:17)
        at require (internal/modules/cjs/helpers.js:25:18)
        at initNode (/home/unxed/far2l/!!next/!!node-cli/nbind/git/project/node_modules/nbind/dist/nbind.js:141:15)
        at /home/unxed/far2l/!!next/!!node-cli/nbind/git/project/node_modules/nbind/dist/nbind.js:115:13
        at findCompiledModule (/home/unxed/far2l/!!next/!!node-cli/nbind/git/project/node_modules/nbind/dist/nbind.js:79:13)
        at find (/home/unxed/far2l/!!next/!!node-cli/nbind/git/project/node_modules/nbind/dist/nbind.js:93:13)
    
    

    Can you please suggest me the directions for further work? Thanks!

    opened by unxed 0
Releases(v0.3.15)
  • v0.3.15(Mar 2, 2018)

  • v0.3.13(Jul 21, 2017)

  • v0.3.12(May 29, 2017)

    • Fix loading multiple addons with identical class and method names.
    • Move @types/node to devDependencies
    • Fix some methods disappearing on Emscripten target.
    Source code(tar.gz)
    Source code(zip)
  • v0.3.11(May 3, 2017)

  • v0.3.10(Apr 23, 2017)

  • v0.3.9(Jan 21, 2017)

    • Support std::function callbacks.
    • Fix passing cbFunction by const reference.
    • Add NBIND_DUPLICATE_POINTERS flag.
    • Update Emscripten detection.
    Source code(tar.gz)
    Source code(zip)
  • v0.3.8(Dec 27, 2016)

  • v0.3.7(Dec 20, 2016)

    • Add noconflict.h to avoid macro naming conflicts.
    • Fix ndts issue when no functions outside classes have bindings.
    • Handle exceptions thrown in JavaScript callbacks.
    Source code(tar.gz)
    Source code(zip)
  • v0.3.6(Dec 12, 2016)

  • v0.3.5(Oct 26, 2016)

    Breaking changes:

    • inherit is now a reserved keyword in NBIND_CLASS sections.

    Other changes:

    • Support (multiple) inheritance.
    • Fix issue with loading multiple addons that use nbind.
    • Fix issue with binding non-copyable classes.
    • Allow renaming bound properties.
    Source code(tar.gz)
    Source code(zip)
  • v0.3.4(Sep 29, 2016)

  • v0.3.3(Sep 26, 2016)

    • Support shared pointers.
    • Support passing unique pointers from C++ to JavaScript.
    • Use shared pointers for all JS-owned objects.
    • Implement light GC (undocumented) on Emscripten target.
    • Sort reflection output to make it deterministic.
    Source code(tar.gz)
    Source code(zip)
  • v0.3.2(Sep 1, 2016)

    Breaking changes:

    • args, multifunction and multimethod are now reserved keywords in NBIND_CLASS sections (put them and the nbind.h include after your own code to avoid conflicts).
    • Improve upper case property name handling, getPROP now becomes PROP instead of pROP.

    Other changes:

    • Allow renaming bound classes.
    • Support const and non-const pointers and references.
    • Support overloaded functions (requires renaming each overload).
    Source code(tar.gz)
    Source code(zip)
  • v0.3.1(Aug 23, 2016)

  • v0.3.0(Jul 29, 2016)

    Breaking changes:

    • Usage in web browsers has been completely overhauled.
    • function is now a reserved keyword in NBIND_CLASS blocks.
    • New syntax for renaming bound methods (still undocumented feature).
      • Argument order was changed.
      • Name visible to JavaScript is now passed as a quoted string.

    Other changes:

    • Reflection support, report type information from C++ method definitions to JavaScript.
    • Support for custom type conversion policies:
      • Enforce stricter type checking
      • Allow null pointers.
    • NBIND_GLOBAL block allows binding functions not belonging to any class.
    • 64-bit integer support.
    • Various bugfixes.
    Source code(tar.gz)
    Source code(zip)
  • v0.2.1(Jun 7, 2016)

    Breaking changes:

    • Value object initializer bind is now a dynamic instead of a static method of the exports object returned by require('nbind')

    Other changes:

    • Fix loading modules from browsers and add basic TypeScript definitions.
    • Add tool to copy compiled asm.js output to a target directory.
    • Avoid losing errors from asm.js init.
    • Fix overriding the toString method on Emscripten target.
    • Support passing pointers on Emscripten target.
    • Fix loading asm.js code without running "npm link nbind".
    • Rewrite documentation.
    Source code(tar.gz)
    Source code(zip)
  • v0.2.0(May 27, 2016)

    Breaking changes:

    • Rename nbind/BindingShort.h to nbind/nbind.h
    • Rename module on JavaScript side from nbind.module to nbind.lib

    Other changes:

    • Add full Emscripten support.
    • Support passing arrays as parameters and return values.
    • Eliminate compiler warnings in Visual Studio.
    • Always compile with -O3.
    • Improve tooling for easier setup.
    • Improve readme and add logo.
    Source code(tar.gz)
    Source code(zip)
  • v0.1.2(May 2, 2016)

  • v0.1.1(Sep 29, 2015)

  • v0.1.0(Aug 31, 2015)

  • v0.0.7(Jul 2, 2015)

    • JavaScript callbacks as parameters to C++ methods.
    • Support GCC and Clang.
    • Map C++ objects to equivalent JavaScript objects using toJS / fromJS methods.
    Source code(tar.gz)
    Source code(zip)
  • v0.0.6(Apr 18, 2015)

  • v0.0.5(Apr 12, 2015)

    • API change: #include "nbind/Binding.h". Before, nbind directory was not needed, so other headers might have been included by accident if nbind header names conflict with another project.
    • Add test harness and set up Travis.
    • Fix methods returning void.
    Source code(tar.gz)
    Source code(zip)
  • v0.0.4(Apr 11, 2015)

    • Fix strings as method arguments. Pointer was accidentally freed before passing it to the called C++ function.
    • Support static class member functions, exposed in JS as properties of the constructor instead of its prototype.
    Source code(tar.gz)
    Source code(zip)
Owner
charto
Creating TypeScript and C++11 tools for geographical maps, charts and easier open source development in general.
charto
Duktape - embeddable Javascript engine with a focus on portability and compact footprint

Duktape ⚠️ Master branch is undergoing incompatible changes for Duktape 3.x. To track Duktape 2.x, follow the v2-maintenance branch. Introduction Dukt

Sami Vaarala 5.4k Sep 29, 2022
Embedded JavaScript engine for C/C++

V7: Embedded JavaScript engine NOTE: this project is deprecated in favor of https://github.com/cesanta/mjs V7 is the smallest JavaScript engine writte

Cesanta Software 1.4k Sep 27, 2022
ChakraCore is an open source Javascript engine with a C API.

ChakraCore ChakraCore is a Javascript engine with a C API you can use to add support for Javascript to any C or C compatible project. It can be compil

null 8.7k Sep 27, 2022
A portable foreign-function interface library.

Status libffi-3.4 was released on TBD. Check the libffi web page for updates: URL:http://sourceware.org/libffi/. What is libffi? Compilers for high le

null 2.6k Oct 5, 2022
A lightweight, dependency-free library for binding Lua to C++

LuaBridge 2.6 LuaBridge is a lightweight and dependency-free library for mapping data, functions, and classes back and forth between C++ and Lua (a po

Vinnie Falco 1.4k Oct 4, 2022
Library to build PHP extensions with C++

PHP-CPP The PHP-CPP library is a C++ library for developing PHP extensions. It offers a collection of well documented and easy-to-use classes that can

Copernica 1.3k Sep 14, 2022
Make screenshot every few minutes to make your small history!

Screenlapse Fun CPP application (which isn't well-made, can be optimized) that automatically make screenshots of your screen every few minutes and sto

raywave's junk projects 3 Aug 18, 2021
Greg's Awesomely Magical Language.

Greg's Awesomely Magical Language (GAML) My friend made PAML (https://github.com/techieji/PAML) so I had to make GAML. What is GAML? GAML is a my firs

Gregory Perrett 1 Nov 27, 2021
Kit: a magical, high performance programming language, designed for game development

Kit: a magical, high performance programming language, designed for game development

Kit Programming Language 991 Sep 30, 2022
Nano is a digital payment protocol designed to be accessible and lightweight, with a focus on removing inefficiencies present in other cryptocurrencies.

Nano is a digital payment protocol designed to be accessible and lightweight, with a focus on removing inefficiencies present in other cryptocurrencies. With ultrafast transactions and zero fees on a secure, green and decentralized network, this makes Nano ideal for everyday transactions.

Nano 3.4k Sep 30, 2022
Nano is a digital payment protocol designed to be accessible and lightweight, with a focus on removing inefficiencies present in other cryptocurrencies.

Nano is a digital payment protocol designed to be accessible and lightweight, with a focus on removing inefficiencies present in other cryptocurrencies. With ultrafast transactions and zero fees on a secure, green and decentralized network, this makes Nano ideal for everyday transactions.

Nano 3.1k May 5, 2021
A PostgreSQL extension providing an async networking interface accessible via SQL using a background worker and curl.

pg_net is a PostgreSQL extension exposing a SQL interface for async networking with a focus on scalability and UX.

Supabase 49 Sep 24, 2022
Introducing to the world - Maze Game! A game with an easily accessible, user-friendly interface that will provide you the serotonin a game should!

Maze-Project Maze game by Maze™ ?? About Introducing to the world - Maze game! ⛏️ Used technologies C++ ✅ Features 3 levels of difficulty User-friendl

Yoana Agafonova 6 Jun 2, 2022
Proof of concept userspace filesystem that executes filenames as shell commands and makes the result accessible though reading the file.

ExecFS Proof of concept userspace filesystem that executes filenames as shell commands and makes the result accessible though reading the file. $ ./ex

Camel Coder 31 Sep 9, 2022
A Rocket League clone designed for the GameBoy Pocket

gb-pocket-league A work-in-progress port of Rocket League to the GameBoy (Pocket)! What a save! What a save! What a save! (README disabled for 3 seco

Tyler Porter 15 Oct 3, 2022
Rocket is an application launcher for KDE Plasma

Rocket is an application launcher for KDE Plasma. It sorts all of your applications in a horizontal or vertical grid alphabetically, so you will always find what you are looking for at first glance. No more menu navigation, only scrolling.

null 23 Mar 25, 2022
Run rocket-chip on FPGA

Starship SoC Generator The starship is short for "STArt RiSc-v on cHIP", hope this project will help you to learn how to run your own RISC-V design on

ZJV 30 Sep 30, 2022
Partial source of the ImGui interfaces used in the Rocket League version of CodeRed.

CodeRed-ImGui Raw source of the ImGui interfaces used in the Rocket League version of CodeRed. About This repo is just part of the ImGui source used i

CodeRed 7 Jun 18, 2022
High-Altitude Sounding Rocket Avionics System (HASRAS)

This is the official repository for HARSAS project from Space Technology Laboratory. The avionics software is based on the Zephyr RTOS to meet the mission profile and the engineering requirments

Space Technology Laboratory 1 Jan 23, 2022