Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

amazingly still works in node v0.4 and npm 1.0

  • Loading branch information...
commit 4631b3fcbf733570b64e327d9ba66cde711f738f 1 parent 1be8de0
@substack authored
View
8 lib/binary.js → binary.js
@@ -1,6 +1,6 @@
-var BufferList = require('../bufferlist');
+var BufferList = require('bufferlist');
var EventEmitter = require('events').EventEmitter;
-var sys = require('sys');
+var util = require('util');
module.exports = Binary;
module.exports.Binary = Binary; // backwards compatibility
@@ -241,7 +241,7 @@ function Binary(buffer) {
throw TypeError(
'Last argument to .into must be a string, number, '
+ 'or a function, not a "' + typeof fv + '".'
- + 'Value supplied: ' + sys.inspect(fv)
+ + 'Value supplied: ' + util.inspect(fv)
);
}
});
@@ -382,7 +382,7 @@ function Binary(buffer) {
throw TypeError(
'Last argument to getBuffer (length) must be a string, number, '
+ 'or a function, not a "' + typeof(length) + '".'
- + 'Value supplied: ' + sys.inspect(length)
+ + 'Value supplied: ' + util.inspect(length)
);
}
View
0  examples/binary.js 100755 → 100644
File mode changed
View
0  examples/hackneyed.js 100755 → 100644
File mode changed
View
0  examples/simple_binary.js 100755 → 100644
File mode changed
View
0  examples/simple_bufferlist.js 100755 → 100644
File mode changed
View
4 package.json
@@ -1,8 +1,8 @@
{
"name": "bufferlist",
- "version": "0.0.6",
+ "version": "0.1.0",
"description": "Create linked lists of Buffer objects",
- "directories": { "lib": "./lib" },
+ "directories": { "lib": "." },
"main": "./bufferlist",
"repository": {
"type": "git",
View
2  test/advance.js
@@ -1,7 +1,7 @@
// Test advancing the buffer
var Buffer = require('buffer').Buffer;
-var BufferList = require('../bufferlist');
+var BufferList = require('bufferlist');
var assert = require('assert');
exports.advance = function () {
View
4 test/binary.js
@@ -1,7 +1,7 @@
// Test the binary interface to bufferlists
var Buffer = require('buffer').Buffer;
-var BufferList = require('../bufferlist').BufferList; // old style
-var Binary = require('../lib/binary').Binary; // old style
+var BufferList = require('bufferlist').BufferList; // old style
+var Binary = require('bufferlist/binary').Binary; // old style
var sys = require('sys');
var assert = require('assert');
View
4 test/binary_assign.js
@@ -1,8 +1,8 @@
// Test .into and hierarchical addressing assignment
var sys = require('sys');
var Buffer = require('buffer').Buffer;
-var BufferList = require('../bufferlist');
-var Binary = require('../lib/binary');
+var BufferList = require('bufferlist');
+var Binary = require('bufferlist/binary');
var assert = require('assert');
exports['binary assign'] = function () {
View
4 test/binary_endianness.js
@@ -2,8 +2,8 @@
// Test binary byte and endianness functions
var sys = require('sys');
var Buffer = require('buffer').Buffer;
-var BufferList = require('../bufferlist');
-var Binary = require('../lib/binary');
+var BufferList = require('bufferlist');
+var Binary = require('bufferlist/binary');
var assert = require('assert');
exports.endianness = function () {
View
4 test/binary_event.js
@@ -1,7 +1,7 @@
var sys = require('sys');
var net = require('net');
-var BufferList = require('../bufferlist');
-var Binary = require('../lib/binary');
+var BufferList = require('bufferlist');
+var Binary = require('bufferlist/binary');
var assert = require('assert');
function parser (sock) {
View
4 test/binary_into.js
@@ -1,8 +1,8 @@
// Check .into(), especially for object pollution
var sys = require('sys');
var Buffer = require('buffer').Buffer;
-var BufferList = require('../bufferlist');
-var Binary = require('../lib/binary');
+var BufferList = require('bufferlist');
+var Binary = require('bufferlist/binary');
var assert = require('assert');
exports.into = function () {
View
4 test/binary_jump.js
@@ -1,7 +1,7 @@
// Jumping around in a binary parser
var Buffer = require('buffer').Buffer;
-var BufferList = require('../bufferlist');
-var Binary = require('../lib/binary');
+var BufferList = require('bufferlist');
+var Binary = require('bufferlist/binary');
var assert = require('assert');
Number.prototype.upTo = function (n) {
View
4 test/binary_loop.js
@@ -2,8 +2,8 @@
var sys = require('sys');
var Buffer = require('buffer').Buffer;
-var BufferList = require('../bufferlist');
-var Binary = require('../lib/binary');
+var BufferList = require('bufferlist');
+var Binary = require('bufferlist/binary');
var assert = require('assert');
exports['binary loop'] = function () {
View
4 test/client_server.js
@@ -1,13 +1,13 @@
// Test a client/server interaction
// If nothing gets printed, everything is fine.
-var sys = require('sys');
+var sys = require('util');
var net = require('net');
var client = new net.Stream;
var assert = require('assert');
exports['client/server'] = function () {
- var BufferList = require('../bufferlist');
+ var BufferList = require('bufferlist');
var bufs = new BufferList({ encoding: 'binary' });
var elems = [];
View
2  test/event.js
@@ -2,7 +2,7 @@
// Test joining lots of chunks into one buffer
var Buffer = require('buffer').Buffer;
-var BufferList = require('../bufferlist');
+var BufferList = require('bufferlist');
var assert = require('assert');
exports.events = function () {
View
2  test/join.js
@@ -1,6 +1,6 @@
// Test joining lots of chunks into one buffer
var Buffer = require('buffer').Buffer;
-var BufferList = require('../bufferlist');
+var BufferList = require('bufferlist');
var assert = require('assert');
exports.join = function () {
View
2  test/take.js
@@ -1,6 +1,6 @@
// Test BufferList#take().
var Buffer = require('buffer').Buffer;
-var BufferList = require('../bufferlist');
+var BufferList = require('bufferlist');
var assert = require('assert');
exports.join = function () {
Please sign in to comment.
Something went wrong with that request. Please try again.