2
0
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:
Nikolay Kostyurin
2018-06-11 22:31:02 +02:00
parent 305643daa2
commit 792e949b6e
36 changed files with 6529 additions and 434 deletions
+3
View File
@@ -0,0 +1,3 @@
package-lock.json
coverage
dist
+5
View File
@@ -0,0 +1,5 @@
package-lock.json
coverage
src
dist
!lib
+3
View File
@@ -0,0 +1,3 @@
#!/usr/bin/env node
require('../lib/cli');
+24
View File
@@ -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);
}
}
+8
View File
@@ -0,0 +1,8 @@
describe('CLI Interface', () => {
test('read from file', () => {
})
});
+26
View File
@@ -0,0 +1,26 @@
{
"name": "@bbob/cli",
"version": "1.0.0",
"description": "Comand line bbcode parser",
"main": "lib/bbob.js",
"bin": {
"cli": "bbob.js"
},
"scripts": {
"test": "../../node_modules/.bin/jest --",
"cover": "../../node_modules/.bin/jest --coverage"
},
"author": "Nikolay Kostyurin <jilizart@gmail.com>",
"license": "MIT",
"directories": {
"lib": "lib"
},
"dependencies": {
"@bbob/parser": "^1.0.0",
"commander": "^2.15.1"
},
"devDependencies": {
"jest": "^23.1.0",
"xbbcode-parser": "^0.1.2"
}
}