Skip to content

Commit

Permalink
Merge pull request #1 from SHaTRO/wip/using-through2
Browse files Browse the repository at this point in the history
Converted to "through2" npm package from "through"
  • Loading branch information
SHaTRO authored Nov 16, 2019
2 parents 0a994ac + 09a79b6 commit a0649ba
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ npm install --save node-shntool
## Code Examples

This is the first release of this interface, it is currently experimental.
It currently supports 'CUE file' generation and joining files.
It currently supports 'CUE file' generation, joining files, and rudimentary format conversion.
The first argument to the promise calls is a string or list of strings used by the 'globby' module to locate the input files.
The second argument to the promise calls is any options for the function itself.

Expand Down
8 changes: 5 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ module.exports = function() {
fs = require('fs-extra'),
path = require('path'),
globby = require('globby'),
through = require('through'),
through = require('through2'),
util = require('util'),
concat = require('concat-stream');

Expand Down Expand Up @@ -71,7 +71,7 @@ module.exports = function() {
stream.on('error', callback);

var curline = '';
function parseOutput(data){
function parseOutput(data, enc, cb){
curline += data;
var barelines = curline.split(/\r?\n/);
curline = barelines.pop();
Expand All @@ -87,6 +87,7 @@ module.exports = function() {
return outfile.substr(1, outfile.length-2);
})));
}
cb(null,data);
}
return stream;
}
Expand Down Expand Up @@ -134,9 +135,10 @@ module.exports = function() {
stream.on('end', callback);
stream.on('error', callback);

function accumulateFile(data) {
function accumulateFile(data, enc, cb) {
//console.log('accumulating');
cuefile += data;
cb(null,data);
}
return stream;
}
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "node-shntool",
"version": "0.2.0-alpha",
"version": "0.2.1",
"description": "Node interface to shntool (http://www.etree.org/shnutils/shntool/)",
"main": "index.js",
"scripts": {
Expand All @@ -24,6 +24,6 @@
"concat-stream": "^2.0.0",
"fs-extra": "^8.1.0",
"globby": "^10.0.1",
"through": "^2.3.8"
"through2": "^3.0.1"
}
}

0 comments on commit a0649ba

Please sign in to comment.