coleccionista
Advanced tools
Comparing version 0.0.2 to 0.0.3
24
index.js
"use strict"; | ||
var inherits = require('util').inherits; | ||
var fs = require('fs'); | ||
var EventEmitter = require("events").EventEmitter; | ||
var PassThrough = require('stream').PassThrough; | ||
var inherits = require("util").inherits; | ||
var fs = require("fs"); | ||
var PassThrough = require("stream").PassThrough; | ||
var Coleccionista = function(filesOrStreams, options) { | ||
if(!filesOrStreams.length) { | ||
throw new Error('Files argument required'); | ||
throw new Error("Files argument required"); | ||
} | ||
@@ -23,12 +22,15 @@ | ||
var self = this, | ||
end = (this.fileIndex === this.files.length-1), | ||
end = (this.fileIndex === this.files.length - 1), | ||
f = this.files[this.fileIndex++], | ||
file = typeof f === 'string' ? fs.createReadStream(f, this.o) : f; | ||
file = typeof f === "string" ? fs.createReadStream(f, this.o) : f; | ||
file | ||
.on('open', function() { | ||
self.emit('itemstart'); | ||
.on("error", function(err) { | ||
self.emit("error", err); | ||
}) | ||
.on('end', function(){ | ||
self.emit('itemend'); | ||
.on("open", function() { | ||
self.emit("itemstart"); | ||
}) | ||
.on("end", function(){ | ||
self.emit("itemend"); | ||
if(!end) { | ||
@@ -35,0 +37,0 @@ self.next(); |
{ | ||
"name": "coleccionista", | ||
"version": "0.0.2", | ||
"version": "0.0.3", | ||
"description": "Helper class that streams files one by one.", | ||
@@ -5,0 +5,0 @@ "keywords": ["stream", "files", "collect"], |
@@ -21,1 +21,2 @@ # Coleccionista # | ||
* __itemend__ — triggers when file stream end | ||
* __error__ — triggers on file errors |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
1918
36
22