2
0
mirror of https://github.com/tenrok/BBob.git synced 2026-06-14 18:42:24 +03:00

fixes lint and test errors

This commit is contained in:
Nikolay Kostyurin
2018-07-08 13:30:13 +02:00
parent 8832c07646
commit 2d02b2241a
19 changed files with 76 additions and 60 deletions
+8 -7
View File
@@ -1,23 +1,24 @@
'use strict';
const fs = require('fs');
const program = require('commander');
const version = require('../package.json').version;
const { version } = require('../package.json');
program
.version(version)
.parse(process.argv);
const options = {};
// eslint-disable-next-line no-unused-vars
function readFile(filename, encoding, callback) {
if (options.file === '-') {
// read from stdin
const chunks = [];
process.stdin.on('data', function (chunk) { chunks.push(chunk); });
process.stdin.on('end', function () {
return callback(null, Buffer.concat(chunks).toString(encoding));
process.stdin.on('data', (chunk) => {
chunks.push(chunk);
});
process.stdin.on('end', () => callback(null, Buffer.concat(chunks).toString(encoding)));
} else {
fs.readFile(filename, encoding, callback);
}