Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

backwards compatible update for var BufferList = require('bufferlist'…

…) style
  • Loading branch information...
commit 14d4f5369f71bc550fd84308d6f8204e9b9344ec 1 parent 0b0d8f0
@substack authored
View
4 bufferlist.js
@@ -3,8 +3,10 @@
var Buffer = require('buffer').Buffer;
var EventEmitter = require('events').EventEmitter;
+module.exports = BufferList;
+module.exports.BufferList = BufferList; // backwards compatibility
+
BufferList.prototype = new EventEmitter;
-exports.BufferList = BufferList;
function BufferList(opts) {
if (!(this instanceof BufferList)) return new BufferList(opts);
View
4 examples/binary.js
@@ -3,8 +3,8 @@
var sys = require('sys');
var net = require('net');
-var BufferList = require('bufferlist').BufferList;
-var Binary = require('bufferlist/binary').Binary;
+var BufferList = require('bufferlist');
+var Binary = require('bufferlist/binary');
function parser (sock) {
var bufferList = new BufferList;
View
2  examples/hackneyed.js
@@ -2,7 +2,7 @@
var sys = require('sys');
var Buffer = require('buffer').Buffer;
-var BufferList = require('bufferlist').BufferList;
+var BufferList = require('bufferlist');
var buf1 = new Buffer(5); buf1.write('abcde');
var buf2 = new Buffer(3); buf2.write('xyz');
View
4 examples/simple_binary.js
@@ -2,8 +2,8 @@
var sys = require('sys');
var Buffer = require('buffer').Buffer;
-var BufferList = require('bufferlist').BufferList;
-var Binary = require('bufferlist/binary').Binary;
+var BufferList = require('bufferlist');
+var Binary = require('bufferlist/binary');
var bufferList = new BufferList;
var binary = Binary(bufferList)
View
2  examples/simple_bufferlist.js
@@ -1,7 +1,7 @@
#!/usr/bin/env node
var sys = require('sys');
var Buffer = require('buffer').Buffer;
-var BufferList = require('bufferlist').BufferList;
+var BufferList = require('bufferlist');
var b = new BufferList;
['abcde','xyz','11358'].forEach(function (s) {
View
6 lib/binary.js
@@ -1,9 +1,11 @@
-var BufferList = require('bufferlist').BufferList;
+var BufferList = require('bufferlist');
var EventEmitter = require('events').EventEmitter;
var sys = require('sys');
+module.exports = Binary;
+module.exports.Binary = Binary; // backwards compatibility
+
Binary.prototype = new EventEmitter;
-exports.Binary = Binary;
function Binary(buffer) {
if (!(this instanceof Binary)) return new Binary(buffer);
View
8 package.json
@@ -1,16 +1,12 @@
{
"name": "bufferlist",
- "version": "0.0.1",
+ "version": "0.0.2",
"description": "Create linked lists of Buffer objects",
- "author": "James Halliday (mail@substack.net)",
-
"directories": { "lib": "./lib" },
- "main": "bufferlist",
-
+ "main": "./bufferlist",
"repository": {
"type": "git",
"url": "http://github.com/substack/node-bufferlist.git"
},
-
"engine": ["node >=0.1.97"]
}
View
2  tests/advance.js
@@ -3,7 +3,7 @@
var assert = require('assert');
var Buffer = require('buffer').Buffer;
-var BufferList = require('bufferlist').BufferList;
+var BufferList = require('bufferlist');
var b = new BufferList;
View
4 tests/binary.js
@@ -3,8 +3,8 @@
var assert = require('assert');
var Buffer = require('buffer').Buffer;
-var BufferList = require('bufferlist').BufferList;
-var Binary = require('bufferlist/binary').Binary;
+var BufferList = require('bufferlist').BufferList; // old style
+var Binary = require('bufferlist/binary').Binary; // old style
var sys = require('sys');
function runTest(bufs, check) {
View
4 tests/binary_assign.js
@@ -4,8 +4,8 @@ var assert = require('assert');
var sys = require('sys');
var Buffer = require('buffer').Buffer;
-var BufferList = require('bufferlist').BufferList;
-var Binary = require('bufferlist/binary').Binary;
+var BufferList = require('bufferlist');
+var Binary = require('bufferlist/binary');
var tapped = 0;
var bList = new BufferList;
View
4 tests/binary_endianness.js
@@ -4,8 +4,8 @@ var assert = require('assert');
var sys = require('sys');
var Buffer = require('buffer').Buffer;
-var BufferList = require('bufferlist').BufferList;
-var Binary = require('bufferlist/binary').Binary;
+var BufferList = require('bufferlist');
+var Binary = require('bufferlist/binary');
var bList = new BufferList;
View
4 tests/binary_event.js
@@ -4,8 +4,8 @@ var sys = require('sys');
var net = require('net');
var assert = require('assert');
-var BufferList = require('bufferlist').BufferList;
-var Binary = require('bufferlist/binary').Binary;
+var BufferList = require('bufferlist');
+var Binary = require('bufferlist/binary');
function parser (sock) {
var bufferList = new BufferList;
View
4 tests/binary_jump.js
@@ -3,8 +3,8 @@
var assert = require('assert');
var Buffer = require('buffer').Buffer;
-var BufferList = require('bufferlist').BufferList;
-var Binary = require('bufferlist/binary').Binary;
+var BufferList = require('bufferlist');
+var Binary = require('bufferlist/binary');
Number.prototype.upTo = function (n) {
var acc = [];
View
4 tests/binary_loop.js
@@ -4,8 +4,8 @@ var assert = require('assert');
var sys = require('sys');
var Buffer = require('buffer').Buffer;
-var BufferList = require('bufferlist').BufferList;
-var Binary = require('bufferlist/binary').Binary;
+var BufferList = require('bufferlist');
+var Binary = require('bufferlist/binary');
// test repeat
var reps = 0;
View
2  tests/client_server.js
@@ -8,7 +8,7 @@ var assert = require('assert');
var net = require('net');
var client = new net.Stream;
-var BufferList = require('bufferlist').BufferList;
+var BufferList = require('bufferlist');
var bufs = new BufferList;
var elems = [];
View
2  tests/event.js
@@ -3,7 +3,7 @@
var assert = require('assert');
var Buffer = require('buffer').Buffer;
-var BufferList = require('bufferlist').BufferList;
+var BufferList = require('bufferlist');
var b = new BufferList;
var times = 0;
View
2  tests/join.js
@@ -3,7 +3,7 @@
var assert = require('assert');
var Buffer = require('buffer').Buffer;
-var BufferList = require('bufferlist').BufferList;
+var BufferList = require('bufferlist');
var buf1 = new Buffer(5); buf1.write('abcde');
var buf2 = new Buffer(3); buf2.write('xyz');
Please sign in to comment.
Something went wrong with that request. Please try again.