Closed johncant closed 11 years ago
There's no way I would have understood it without your efforts.
Find an 'in-production' node module here https://github.com/substance/store
I fixed some stuff lately... and this is really working. (including npm setup)
%module redis
%header %{
#define SWIG 1
#include <jsobjects_v8.hpp>
#include <redis_error.hpp>
#include <redis_access.hpp>
using namespace jsobjects;
%}
%include <std_string.i>
%include <node.i>
%include <jsobjects.i>
/* important: declare all methods which create new instances here */
%newobject RedisAccess::Create;
%newobject RedisAccess::asList;
%newobject RedisAccess::asHash;
%include "redis_error.hpp"
%include "redis_access.hpp"
%node(redis)
Notes:
<node.i>
: includes everything necessary for node buildHave a look at this and provide feedback :)
You're right. I built my node module with node-waf, which is deprecated. DUH!
Hi guys,
thanks to @oliver---- 's gist and his code, I got my header to SWIGify then compile, but only after adding the 'init' function which the node runtime looks for.
I also added two macros, which seem to make sense given equivalent macros for other languages - are they right?