mirror of
https://github.com/tenrok/BBob.git
synced 2026-06-08 17:22:26 +03:00
add eslint, travis config, test tasks
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
'use strict';
|
||||
|
||||
const fs = require('fs');
|
||||
const program = require('commander');
|
||||
const version = require('../package.json').version;
|
||||
|
||||
program
|
||||
.version(version)
|
||||
.parse(process.argv);
|
||||
|
||||
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));
|
||||
});
|
||||
} else {
|
||||
fs.readFile(filename, encoding, callback);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user