Native Abstractions for Node.js: A header file filled with macro and utility goodness for making native add-on module development easier across all major releases of Node.js
Questions tagged [node.js-nan]
51 questions
0
votes
1 answer
How to create namespace hierarchy in node.js addon?
I'm creating a node.js addon, which has bunch of classes. I want to organize them in a hierarchical namespace. If I were doing this in Javascript it would look like this
var com = function() {};
com.example = function() {};
com.example.Person =…

Jayesh
- 51,787
- 22
- 76
- 99
0
votes
1 answer
How to use new version of Node Nan Persistent
With new version of Nan what would be the equivalent code for following:
The following code works with 0.12.* but not on 4.3.0 and later.
//1)
//This is my object_
Persistent

Royal Pinto
- 2,869
- 8
- 27
- 39
0
votes
1 answer
How do I check whether an object is an instance of a constructor in Nan 2?
Nan 1.x had a function NanHasInstance(Persistent&, Handle) to check whether an object is an instance of a constructor. However, that function was removed in nan 2.0, and there isn't an obvious replacement. Does nan still…

murgatroid99
- 19,007
- 10
- 60
- 95
0
votes
1 answer
Node.js C++ Binding error: expected constructor, destructor, or type conversion before ‘(’ token
I am attempting to update a Node.js module's C bindings. I am getting this error:
../src/cas.cc: At global scope:
../src/cas.cc:58:18: error: expected constructor, destructor, or type conversion before ‘(’ token
NAN_WEAK_CALLBACK(casDtor) {
The…

Corbin
- 1
0
votes
2 answers
How should I throw an error with a numeric code in NAN 1.x?
In NAN 1.9, the NanThrowError(const char *msg, const int errorNumber) method was deprecated, and it looks like an equivalent method is not present in NAN 2.0. Is there another way to get this same functionality with NAN, or is it just gone entirely?

murgatroid99
- 19,007
- 10
- 60
- 95
0
votes
1 answer
how can a NanAsyncWorker parameter be "undeclared identifier"
I have this code
(from https://github.com/nodejs/nan/tree/master/examples/async_pi_estimate )
class PiWorker : public NanAsyncWorker {
public:
PiWorker( NanCallback *callback, NanUtf8String sz_QMN )
: NanAsyncWorker( callback ) {}
…

Sebastia.Net
- 129
- 2
- 14