uupaa / MessagePack.js

MessagePack implementation
MIT License
1 stars 1 forks source link

Could not import the module #3

Open monolithed opened 9 years ago

monolithed commented 9 years ago
➜ node
>  var messagepack = require('uupaa.messagepack.js');
node_modules/uupaa.messagepack.js/lib/MessagePack.js:4
var entity = GLOBAL["WebModule"]["exports"](name, closure);
                                ^
TypeError: Cannot read property 'exports' of undefined
require("<module-dir>lib/WebModule.js");
require("<module-dir>lib/MessagePack.js");

It's not nodejs style You'd provide a bower file for client side, and package.json for nodejs.

// index.js should be something like:

var WebModule = require("./lib/WebModule");
var MessagePack = require("./lib/MessagePack");

module.exports = MessagePack;