Skip to content

Commit

Permalink
fix(cli): handle larger inputs
Browse files Browse the repository at this point in the history
  • Loading branch information
coderbyheart committed Oct 3, 2022
1 parent 48dd1ab commit 2cd8e86
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
8 changes: 7 additions & 1 deletion reporter/console-cli.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
import { consoleReporter } from './consoleReporter.js'

const chunks: string[] = []

process.stdin.on('data', (data) => {
consoleReporter(JSON.parse(data.toString()), console.log)
chunks.push(data.toString())
})

process.stdin.on('end', () => {
consoleReporter(JSON.parse(chunks.join('')), console.log)
})
8 changes: 7 additions & 1 deletion reporter/markdown-cli.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
import { markdownReporter } from './markdownReporter.js'

const chunks: string[] = []

process.stdin.on('data', (data) => {
console.log(markdownReporter(JSON.parse(data.toString())))
chunks.push(data.toString())
})

process.stdin.on('end', () => {
console.log(markdownReporter(JSON.parse(chunks.join(''))))
})

0 comments on commit 2cd8e86

Please sign in to comment.