{"_id":"@tapjs/tap-finished","_rev":"1762547","name":"@tapjs/tap-finished","description":"detect when tap output is finished","dist-tags":{"latest":"0.0.3"},"maintainers":[{"name":"ljharb","email":"ljharb@gmail.com"},{"name":"isaacs","email":"i@izs.me"}],"time":{"modified":"2026-11-27T09:47:48.000Z","created":"2022-09-22T23:06:27.758Z","0.0.3":"2022-09-23T04:41:41.419Z","0.0.2":"2022-09-22T23:27:10.829Z","0.0.1":"2022-09-22T23:06:27.758Z"},"users":{},"author":{"name":"James Halliday","email":"mail@substack.net","url":"http://substack.net"},"repository":{"type":"git","url":"git://github.com/tapjs/tap-finished.git"},"versions":{"0.0.3":{"name":"@tapjs/tap-finished","version":"0.0.3","description":"detect when tap output is finished","main":"index.js","dependencies":{"object.assign":"^4.1.4","tap-parser":"^5.4.0"},"devDependencies":{"@ljharb/eslint-config":"^21.0.0","aud":"^2.0.1","auto-changelog":"^2.4.0","eslint":"=8.8.0","npmignore":"^0.3.0","tap":"^9.0.3","tape":"^5.6.1"},"scripts":{"prepack":"npmignore --auto --commentLines=autogenerated","version":"auto-changelog && git add CHANGELOG.md","postversion":"auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\"","lint":"eslint --ext=js,mjs .","pretest":"npm run lint","tests-only":"tap test/*.js","test":"npm run tests-only","posttest":"aud --production"},"testling":{"files":"test/*.js","browsers":["ie/8","ie/9","firefox/latest","chrome/latest","safari/latest","opera/latest"]},"repository":{"type":"git","url":"git://github.com/tapjs/tap-finished.git"},"homepage":"https://github.com/tapjs/tap-finished","keywords":["tap","parse","stream","complete","test"],"author":{"name":"James Halliday","email":"mail@substack.net","url":"http://substack.net"},"funding":{"url":"https://github.com/sponsors/ljharb"},"license":"MIT","auto-changelog":{"output":"CHANGELOG.md","template":"keepachangelog","unreleased":false,"commitLimit":false,"backfillLimit":false,"hideCredit":true},"publishConfig":{"ignore":[".github/workflows","example/"]},"gitHead":"42d1c0d372a8fc1e85e12ba3c7bdf82d17ce070b","bugs":{"url":"https://github.com/tapjs/tap-finished/issues"},"_id":"@tapjs/tap-finished@0.0.3","_nodeVersion":"18.9.0","_npmVersion":"8.19.1","dist":{"integrity":"sha512-cnOg0S1CnbfB3MCtmIU4FcvNCz2nyJOIEQJvnSxR0B10GU32MsFr+7F+k6EJvumnIFxcS/G+sSc6y0AV09TMbw==","shasum":"33e422995160fe603fcec985d23c4b6a24b2051b","tarball":"http://registry-npm.ywwl.com/@tapjs/tap-finished/download/@tapjs/tap-finished-0.0.3.tgz","fileCount":12,"unpackedSize":17269,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDpr2ZKSz0InE1a1XVdfD+nmQY4T1YhPkwU/KmW5pN09QIgXAuIVshQpc/j+zMIg3pRf4RXe0rVA0vjGSjp2UIszak="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjLTkFACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmo7tA//S7Zte0stbA8BKx0vZVcm/3YnRKzKPORsFiGt4iRM2KRtmFae\r\nif865QZyEa2pIqV4VhSKTb+RWmbfiG0VsTrTI0VNIHxbiklIdrMdacTjjkwx\r\nC7JFcfqlQGkRFBphHjPPh4xdL2IO8i8K+Bj4i5vgcCOZ8zpyEy4kne1r/pMy\r\n2xGE4YNkOd20ubqNGI7u6fHMs6SWMkS4XwoenDmoSshHgde7xQNur/3KZXSu\r\noPpnOhu48jPqPvjhqBo9lQpnpNytcoDqiKLYjE/U8GaF1f5ciqjBhwo28/o2\r\n+EOU8HW1SxSsn4MoRSchiO0yrgR7iThN08KlER8L5z3QAzgV+LWmLK6EmzsY\r\nDrwCg96J7QXvf46//7YyfhrR4X2G3SHbUASWBSzUWfCmPc0lpb33AVpBLyO+\r\nQ63kNjNHHW0OJ0slJSfUwfuG0PE9A0yjrlZ15XG9sC6UHsLP7Wt7Qm3Hg9Un\r\nNdRyMXiB1by5hVnKeLningDFllsK6RpQS+pC/axH5oPBCzQHWFq36lW9N+Qu\r\nxpGU3k3tE8lhEZ84gcMJBaa4hZZScclcNHehVHVtcIZtCF48E5e2ul+9TXJS\r\n0lvIkGZrLRps35ye70KqdULcbiEPuTwV279R4nCWoTYJdBlSWfMkdh2R/se0\r\nr6J/M26Fq6tVnTtzmHtn828gwGKKxn/tnXQ=\r\n=freL\r\n-----END PGP SIGNATURE-----\r\n","size":5879,"noattachment":false,"key":"/@tapjs/tap-finished/-/@tapjs/tap-finished-0.0.3.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.3_1663908101220_0.12727971593962617"},"_hasShrinkwrap":false,"publish_time":1663908101419,"_cnpm_publish_time":1663908101419},"0.0.2":{"name":"@tapjs/tap-finished","version":"0.0.2","description":"detect when tap output is finished","main":"index.js","dependencies":{"tap-parser":"^0.2.1","through":"^2.3.8"},"devDependencies":{"auto-changelog":"^2.4.0","npmignore":"^0.3.0","tap":"^0.4.13","tape":"^5.6.1"},"scripts":{"prepack":"npmignore --auto --commentLines=autogenerated","version":"auto-changelog && git add CHANGELOG.md","postversion":"auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\"","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/tapjs/tap-finished.git"},"homepage":"https://github.com/tapjs/tap-finished","keywords":["tap","parse","stream","complete","test"],"author":{"name":"James Halliday","email":"mail@substack.net","url":"http://substack.net"},"license":"MIT","auto-changelog":{"output":"CHANGELOG.md","template":"keepachangelog","unreleased":false,"commitLimit":false,"backfillLimit":false,"hideCredit":true},"publishConfig":{"ignore":[".github/workflows"]},"gitHead":"2bdd5d5eab0a1c6b11867bee9af48b82c47a53ef","bugs":{"url":"https://github.com/tapjs/tap-finished/issues"},"_id":"@tapjs/tap-finished@0.0.2","_nodeVersion":"18.9.0","_npmVersion":"8.19.1","dist":{"integrity":"sha512-H8dEIcLoCvGFRW601fQDnEeQj9TMbtzUo1jRxUw3ey0yD0dOeThTKnoyWboPuGtcUvfTpAgS4ElcWkQcKocuXQ==","shasum":"07b2ab5b55183e0124185746003958d7fabafe68","tarball":"http://registry-npm.ywwl.com/@tapjs/tap-finished/download/@tapjs/tap-finished-0.0.2.tgz","fileCount":13,"unpackedSize":14862,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHvGmExhqZDzMuiV+Z81zPXpIiSUbFtyre1EUEr+WqPhAiEAvM8egrJFHUSC+byk6qTBnu/OUMREJtSNMZvpvQv0HEQ="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjLO9OACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpCeA/7Bfn6QCgbjaQ1/NMkYdL6zG80Y0ZUX4QgabXmpuCxJgAiSSas\r\nu9RQsxtjEEhJIUavfxrpC0VwRh0PFmirm8MVrZZCi8VI0XS8YtFUPvXH1irK\r\nQardoj1qAqKQTUOOixdaDge7mksnkUJq1CYRb38Ci2kL/VG1ALQ5Mu9ovQsO\r\nv+uodJzWKFeHG7RNO/q4cYMS1EOET0le8XGZikH1SfAe0xknoXmOvns9K52U\r\n1/Malrp4ZQEFaECtT3n7pYQEkcsXrdID8mTYYt9TLq+c5WWlo9+DnFa34PvG\r\n1mvKLnjqvWNBSTDMUuaW+ryCVnVR8PfcpueZAwhmSsA3F+s4XgNKU3/2a8++\r\nBxYFWc9yM60cxBiGbX7oThjRCYyxL5lc938N63OJ7k/7UW+2P+lrnr1JvxTg\r\ndFGnFUPft3kkL8JHKWc3AYnY37ocam6/94cQ7LuKTHJxEboaHw1f1OW1p9ZR\r\nVcIk2yJLdIGDK+EXu22H3tjPbYi78WBhe7WunAod1bhB5KHaQW0YznJzSe4D\r\nChuprswpUVQnJi/hx4+bsdtizyeUf67arrGSfXIvbNPyEUc4ex5QzdxUvdI8\r\nHwCzUtCT+zhq3/VMXz1ZkRtzphXWapvCENiWdzhBUavQHiqETUN9HUzY5FU9\r\nokf/gkXeZ+kxXPbedpCNZBpZ3xeGXETixH8=\r\n=Clzx\r\n-----END PGP SIGNATURE-----\r\n","size":4903,"noattachment":false,"key":"/@tapjs/tap-finished/-/@tapjs/tap-finished-0.0.2.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.2_1663889230597_0.6753868801198746"},"_hasShrinkwrap":false,"publish_time":1663889230829,"_cnpm_publish_time":1663889230829},"0.0.1":{"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,"publish_time":1663887987758,"_cnpm_publish_time":1663887987758}},"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","_attachments":{},"homepage":"https://github.com/tapjs/tap-finished","bugs":{"url":"https://github.com/tapjs/tap-finished/issues"},"license":"MIT"}