{"name":"@tapjs/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","gitHead":"2ccdf351d1c26106c8a93932ff9ef0fe9e05deac","bugs":{"url":"https://github.com/substack/tap-finished/issues"},"_id":"@tapjs/tap-finished@0.0.1","_nodeVersion":"18.9.0","_npmVersion":"8.19.1","dist":{"integrity":"sha512-TUpRPtp6bDsCMYpmUBbB8LhMo9uZGZ4Oa8+qSKKbbDdlvY8RuyQ93dRDmrgLophSLIFTJIaT+aMkHB8qqaBFwg==","shasum":"83b28b381f6a81224d4bbf046ff7957fe08687dc","tarball":"http://registry-npm.ywwl.com/@tapjs/tap-finished/download/@tapjs/tap-finished-0.0.1.tgz","fileCount":12,"unpackedSize":10405,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDruBBg9MblLJ4EbANy/boKhtbVmG23u7u5je6kDxJ22wIge95xGwHU8oJnVDfQ8dOOoUs7RH5lwxOGC1RRvblNRGQ="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjLOpzACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqQoQ/8CcaxkGh8kbokHfiPZRKPOz2w5u3tEZ7zg/y+TieFazt6mciV\r\n4fravMPASrLtXxDJA0M4InLAfcGPz/YuG72zYIktSDMuhLZ8g6Up+X2pSF5P\r\nkzQcpFRtsDKFEvlhbEQxxkmS0Y+Tqz55Fj+geXrsCcxT79IZYTNPrSrKU133\r\noxtNSZ0rdq6HX8QoQN1jaMV0BuokPXY95doJokMxTY/4m09h/1fkK1Rqa8iu\r\ndd5441eDUjB5K4WjJYkbwSUUrnjSlKEMPxDn10WF/6OZSYy8O58dXeIpJMDm\r\nikFNk9cNTAZ/D2/14/oKd4gRkegT0z9GYS9KCLuXcQb1Z6NLrChKMwpOIOmP\r\nA1LNiXq+E4+DjDbQKvBgr4HEWzQLATHWgcRXFTiZc9VFk3JtuyuF1bdCO5UO\r\nDGYMYCucfOIucfyVy+S6YiNxndDBbOQpReLL8FyYzV/Ypsq7YFIgx6wPCb95\r\np2tmlx5pITkbPL83Gg9dkqHYCUKM5cLq+AhW4NaDODqus/RHuzzywqbOTwZ/\r\nrJQZd4c/4WEL6+GOra9PeNefgZHsM8Dxvyufk7cK9JJONrmNrZoEydW36VJ2\r\nwYXICO1ftZyWJiUYceSs9Tjgl0GrfU8yrgwR0pQoa8+i7fzZwkAkH858bfW7\r\npP46Siq9wPRWtmLZmDD/8GQa0r2IJkv1JOI=\r\n=iy4E\r\n-----END PGP SIGNATURE-----\r\n","size":3196,"noattachment":false,"key":"/@tapjs/tap-finished/-/@tapjs/tap-finished-0.0.1.tgz"},"_npmUser":{"name":"ljharb","email":"ljharb@gmail.com"},"directories":{},"maintainers":[{"name":"ljharb","email":"ljharb@gmail.com"},{"name":"isaacs","email":"i@izs.me"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/tap-finished_0.0.1_1663887987553_0.2272823995247577"},"_hasShrinkwrap":false,"readme":"# tap-finished\n\ndetect when [tap output](http://testanything.org) is finished\n\n[![build status](https://secure.travis-ci.org/tapjs/tap-finished.png)](http://travis-ci.org/tapjs/tap-finished)\n\n[![browser support](http://ci.testling.com/tapjs/tap-finished.png)](http://ci.testling.com/tapjs/tap-finished)\n\nNormally with [tap-parser](https://github.com/tapjs/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/tapjs/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","publish_time":1663887987758,"_cnpm_publish_time":1663887987758,"dist-tags":{"latest":"0.0.3"}}