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,3 @@
|
||||
package-lock.json
|
||||
coverage
|
||||
dist
|
||||
@@ -0,0 +1,5 @@
|
||||
package-lock.json
|
||||
coverage
|
||||
src
|
||||
dist
|
||||
!lib
|
||||
@@ -0,0 +1,3 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
require('../lib/cli');
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
|
||||
|
||||
|
||||
describe('CLI Interface', () => {
|
||||
test('read from 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"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user