Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

q-io

Package Overview
Dependencies
Maintainers
1
Versions
80
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

q-io - npm Package Compare versions

Comparing version 0.0.15 to 0.0.16

README.md

4

package.json
{
"name": "q-io",
"version": "0.0.15",
"version": "0.0.16",
"description": "Q Promise wrappers for Node's IO.",

@@ -19,3 +19,3 @@ "homepage": "http://github.com/kriskowal/q-io/",

"dependencies": {
"q": "0.8.8"
"q": "0.8.x"
},

@@ -22,0 +22,0 @@ "repository": {

@@ -46,17 +46,13 @@

begin.resolve(self);
if (receiver)
if (receiver) {
receiver(chunk);
else
} else {
chunks.push(chunk);
}
});
function slurp() {
if (charset) {
var result = chunks.join("");
chunks = [];
return result;
} else {
consolidate(chunks);
return chunks.shift();
}
var result = join(chunks, charset);
chunks.splice(0, chunks.length);
return result;
}

@@ -73,6 +69,5 @@

var deferred = Q.defer();
Q.when(end.promise, function () {
Q.done(end.promise, function () {
deferred.resolve(slurp());
})
.end()
});
return deferred.promise;

@@ -139,3 +134,3 @@ };

if (!_stream.writeable && !_stream.writable)
return Q.reject("Stream not writable");
return Q.reject(new Error("Can't write to non-writable (possibly closed) stream"));
if (!_stream.write(content)) {

@@ -188,4 +183,4 @@ return drained.promise;

exports.consolidate = consolidate;
function consolidate(buffers) {
exports.join = join;
function join(buffers) {
var length = 0;

@@ -209,3 +204,20 @@ var at;

buffers.splice(0, ii, result);
return result;
}
/*
Reads an entire forEachable stream of buffers and returns a single buffer.
*/
exports.read = read;
function read(stream, charset) {
var chunks = [];
stream.forEach(function (chunk) {
chunks.push(chunk);
});
if (charset) {
return chunks.join("");
} else {
return join(chunks);
}
}

@@ -0,1 +1,2 @@

var Q = require("q");

@@ -2,0 +3,0 @@ var FS = require("q-fs");

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc