From 6e6b51ca10a2d1cd0bb80d693c33341d2204c3ef Mon Sep 17 00:00:00 2001 From: roblabla Date: Fri, 22 May 2015 19:00:01 +0000 Subject: [PATCH] Better node compatibility : Use readable-stream --- package.json | 1 + src/transforms/compression.js | 2 +- src/transforms/framing.js | 2 +- src/transforms/serializer.js | 2 +- 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 479a97e..168d562 100644 --- a/package.json +++ b/package.json @@ -44,6 +44,7 @@ "buffer-equal": "0.0.0", "node-uuid": "~1.4.1", "prismarine-nbt": "0.0.1", + "readable-stream": "^1.1.0", "superagent": "~0.10.0", "ursa-purejs": "0.0.3" }, diff --git a/src/transforms/compression.js b/src/transforms/compression.js index 6a1ded0..7049542 100644 --- a/src/transforms/compression.js +++ b/src/transforms/compression.js @@ -1,6 +1,6 @@ var [readVarInt, writeVarInt, sizeOfVarInt] = require("../datatypes/utils").varint; var zlib = require("zlib"); -var Transform = require("stream").Transform; +var Transform = require("readable-stream").Transform; module.exports.createCompressor = function(threshold) { return new Compressor(threshold); diff --git a/src/transforms/framing.js b/src/transforms/framing.js index b6607ad..5e8d45b 100644 --- a/src/transforms/framing.js +++ b/src/transforms/framing.js @@ -1,5 +1,5 @@ var [readVarInt, writeVarInt, sizeOfVarInt] = require("../datatypes/utils").varint; -var Transform = require("stream").Transform; +var Transform = require("readable-stream").Transform; module.exports.createSplitter = function() { return new Splitter(); diff --git a/src/transforms/serializer.js b/src/transforms/serializer.js index 99136c0..fb896ae 100644 --- a/src/transforms/serializer.js +++ b/src/transforms/serializer.js @@ -1,6 +1,6 @@ var [readVarInt, writeVarInt, sizeOfVarInt] = require("../datatypes/utils").varint; var protocol = require("../protocol"); -var Transform = require("stream").Transform; +var Transform = require("readable-stream").Transform; module.exports.createSerializer = function(obj) { return new Serializer(obj);