{"name":"tap-finished","version":"0.0.1","description":"detect when tap output is finished","main":"index.js","dependencies":{"through":"~2.3.4","tap-parser":"~0.2.0"},"devDependencies":{"tap":"~0.4.6","tape":"~2.3.0"},"scripts":{"test":"tap test/*.js"},"testling":{"files":"test/*.js","browsers":["ie/8","ie/9","firefox/latest","chrome/latest","safari/latest","opera/latest"]},"repository":{"type":"git","url":"git://github.com/substack/tap-finished.git"},"homepage":"https://github.com/substack/tap-finished","keywords":["tap","parse","stream","complete","test"],"author":{"name":"James Halliday","email":"mail@substack.net","url":"http://substack.net"},"license":"MIT","readme":"# tap-finished\n\ndetect when [tap output](http://testanything.org) is finished\n\n[![build status](https://secure.travis-ci.org/substack/tap-finished.png)](http://travis-ci.org/substack/tap-finished)\n\n[![browser support](http://ci.testling.com/substack/tap-finished.png)](http://ci.testling.com/substack/tap-finished)\n\nNormally with [tap-parser](https://github.com/substack/tap-parser) the\n`'results'` event fires only after the stream is closed. This module lets you\ndetect whether a stream seems closed without waiting for the `'end'` event.\n\n# example\n\nGiven this tap output in `tap_output.txt`:\n\n```\nTAP version 13\n# wait\nok 1 (unnamed assert)\nnot ok 2 should be equal\n  ---\n    operator: equal\n    expected: 5\n    actual:   4\n  ...\n\n1..2\n# tests 2\n# pass  1\n# fail  1\n```\n\nand given this script that pipes stdin into the finished stream:\n\n``` js\nvar finished = require('tap-finished');\nvar stream = finished(function (results) {\n    console.dir(results);\n});\nprocess.stdin.pipe(stream);\n```\n\nWe'll use `cat` to create a stream that contains the tap output but doesn't end\nand then pipe that to the script:\n\n```\n$ cat tap_output.txt /dev/stdin | node stream.js \n{ ok: false,\n  asserts: \n   [ { ok: true, number: 1, name: '(unnamed assert)' },\n     { ok: false, number: 2, name: 'should be equal' } ],\n  pass: [ { ok: true, number: 1, name: '(unnamed assert)' } ],\n  fail: [ { ok: false, number: 2, name: 'should be equal' } ],\n  errors: [],\n  plan: { start: 1, end: 2 } }\n^C\n```\n\nEven though the `'end'` message never came, we still got the parsed results.\nYay!\n\n# methods\n\n``` js\nvar finished = require('tap-finished')\n```\n\n## var ws = finished(opts={}, cb)\n\nReturn a writable stream `ws` that consumes tap input. \n`cb(results)` fires with the `results` from\n[tap-parser](https://github.com/substack/tap-parser)\nwhen the stream seems finished or when the `'end'` event occurs.\n\n`opts.wait` controls how long to wait in milliseconds for more input before\nfiring the `cb` if the `'end'` event doesn't fire.\n\n# install\n\nWith [npm](http://npmjs.org) do:\n\n```\nnpm install tap-finished\n```\n\nYou can use this module in the browser with [browserify](http://browserify.org).\n\n# license\n\nMIT\n","readmeFilename":"readme.markdown","bugs":{"url":"https://github.com/substack/tap-finished/issues"},"_id":"tap-finished@0.0.1","dist":{"shasum":"08b5b543fdc04830290c6c561279552e71c4bd67","tarball":"https://registry.npmjs.org/tap-finished/-/tap-finished-0.0.1.tgz","integrity":"sha512-50OfezyPHtVfjMMqNp4s9h+McsisbZIS4J2/kwOEXAGQh3EJvS0HVKpj2o2TiTTmpAVkw1jLK4s+1U+FFIknIQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCC2KFTqWRcyqS1p/ry6Kn2+pK9aJrksEG6811i0mwqswIhAMvk+u1xACvmFEPIm8U1qYJ1YY8c7dF1yiP4WSDnxWV4"}]},"_from":".","_npmVersion":"1.3.14","_npmUser":{"name":"substack","email":"mail@substack.net"},"maintainers":[{"name":"substack","email":"mail@substack.net"}],"directories":{}}