musicmetadata
Advanced tools
Comparing version 2.0.3 to 2.0.4
@@ -9,25 +9,7 @@ 'use strict' | ||
module.exports = function (stream, opts, callback) { | ||
var wrappedStream = wrapFileWithStream(stream) | ||
if (typeof opts === 'function') { | ||
callback = opts | ||
opts = {} | ||
} | ||
if (opts.autoClose) { | ||
return musicmetadata(wrappedStream.dest, opts, function () { | ||
// Once we have our meta data we abort stream file reader | ||
wrappedStream.abort() | ||
callback.apply(null, arguments) | ||
}) | ||
} | ||
return musicmetadata(wrappedStream.dest, opts, callback) | ||
return musicmetadata(wrapFileWithStream(stream), opts, callback) | ||
} | ||
function wrapFileWithStream (file) { | ||
var | ||
streamFileReader, | ||
stream = through(function write (data) { | ||
var stream = through(function write (data) { | ||
if (data.length > 0) this.queue(data) | ||
@@ -56,6 +38,3 @@ }, null, {autoDestroy: false}) | ||
streamFileReader = readStream(file) | ||
streamFileReader.pipe(stream) | ||
return streamFileReader | ||
return readStream(file).pipe(stream) | ||
} | ||
@@ -62,0 +41,0 @@ |
{ | ||
"name": "musicmetadata", | ||
"description": "Streaming music metadata parser for node and the browser.", | ||
"version": "2.0.3", | ||
"version": "2.0.4", | ||
"author": "Lee Treveil", | ||
@@ -6,0 +6,0 @@ "dependencies": { |
Sorry, the diff of this file is too big to display
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
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
304901
8932