feat(bin): add CLI

This commit is contained in:
zkochan
2017-01-15 01:54:00 +02:00
parent 1d7215c67c
commit 898eb91cbb
4 changed files with 18 additions and 0 deletions

View File

@@ -7,6 +7,7 @@
"files": [
"lib"
],
"bin": "lib/bin/pnpm-reporter-default.js",
"scripts": {
"test": "tslint -c tslint.json --project .",
"tsc": "rimraf lib && tsc",
@@ -27,7 +28,9 @@
"homepage": "https://github.com/pnpm/pnpm-reporter-default#readme",
"dependencies": {
"@types/chalk": "^0.4.31",
"@types/node": "^7.0.0",
"chalk": "^1.1.3",
"ndjson": "^1.5.0",
"observatory": "^1.0.0",
"pnpm-logger": "^0.0.0"
},

View File

@@ -0,0 +1,9 @@
#!/usr/bin/env node
import ndjson = require('ndjson')
import reporter from '..'
process.stdin.resume()
process.stdin.setEncoding('utf8')
const streamParser = process.stdin
.pipe(ndjson.parse())
reporter(streamParser)

View File

@@ -22,6 +22,7 @@
"rewriteTsconfig": true
},
"files": [
"src/bin/pnpm-reporter-default.ts",
"src/index.ts",
"typings/index.d.ts",
"typings/local.d.ts"

5
typings/local.d.ts vendored
View File

@@ -2,3 +2,8 @@ declare module 'observatory' {
const anything: any;
export = anything;
}
declare module 'ndjson' {
const anything: any;
export = anything;
}