Skip to content

Commit

Permalink
[fix] use binary-pack module so we only need to npm install one extra…
Browse files Browse the repository at this point in the history
… dependency for binary support
  • Loading branch information
jcrugzz committed Aug 19, 2013
1 parent 71ced0b commit 712ba5c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
3 changes: 1 addition & 2 deletions package.json
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@
"ws": "0.4.x", "ws": "0.4.x",
"sockjs-client-node": "0.0.x", "sockjs-client-node": "0.0.x",
"request": "2.21.x", "request": "2.21.x",
"js-binarypack": "git://github.com/jcrugzz/js-binarypack.git#make-requireable", "binary-pack": "0.0.x"
"binarypack": "0.0.x"
} }
} }
2 changes: 1 addition & 1 deletion parsers.json
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
"server": "e-json" "server": "e-json"
}, },
"binary": { "binary": {
"server": "binarypack js-binarypack" "server": "binary-pack"
} }
} }
7 changes: 3 additions & 4 deletions parsers/binary.js
Original file line number Original file line Diff line number Diff line change
@@ -1,7 +1,6 @@
'use strict'; 'use strict';


var BinaryPack = require('binarypack') var BinaryPack = require('binary-pack');
, fs = require('fs');


/** /**
* Message encoder. * Message encoder.
Expand Down Expand Up @@ -32,8 +31,8 @@ exports.decoder = function decoder(data, fn) {
// //
exports.library = [ exports.library = [
'var BinaryPack = (function () {', 'var BinaryPack = (function () {',
' try { return require("binarypack"); }', ' try { return require("binary-pack"); }',
' catch (e) {}', ' catch (e) {}',
fs.readFileSync(require.resolve('js-binarypack'), 'utf-8'), BinaryPack.BrowserSource,
'})();' '})();'
].join('\n'); ].join('\n');

0 comments on commit 712ba5c

Please sign in to comment.