{"id":17398460,"url":"https://github.com/vweevers/tap-completed","last_synced_at":"2025-04-30T05:23:01.499Z","repository":{"id":66220593,"uuid":"285750546","full_name":"vweevers/tap-completed","owner":"vweevers","description":"Detect when TAP output has completed.","archived":false,"fork":false,"pushed_at":"2024-11-17T12:46:29.000Z","size":21,"stargazers_count":1,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-25T01:58:22.203Z","etag":null,"topics":["nodejs","npm-package","stream","tap","test-anything-protocol"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vweevers.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-08-07T06:01:29.000Z","updated_at":"2024-11-17T12:46:33.000Z","dependencies_parsed_at":null,"dependency_job_id":"b9ec8a21-f03a-4c91-97e3-1b765a771636","html_url":"https://github.com/vweevers/tap-completed","commit_stats":{"total_commits":5,"total_committers":1,"mean_commits":5.0,"dds":0.0,"last_synced_commit":"e2a77f8acba6a6fa2626fedf305729291baf464b"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vweevers%2Ftap-completed","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vweevers%2Ftap-completed/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vweevers%2Ftap-completed/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vweevers%2Ftap-completed/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vweevers","download_url":"https://codeload.github.com/vweevers/tap-completed/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251646038,"owners_count":21620855,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["nodejs","npm-package","stream","tap","test-anything-protocol"],"created_at":"2024-10-16T14:56:51.225Z","updated_at":"2025-04-30T05:23:01.476Z","avatar_url":"https://github.com/vweevers.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# tap-completed\n\n**Detect when [TAP](https://testanything.org/) output has completed.** Normally with [`tap-parser`](https://github.com/tapjs/tap-parser) the `complete` event fires only when the stream ends. This module detects and waits for the expected number of assertions and then ends the stream. This is an updated and API-compatible version of [`tap-finished`](https://github.com/substack/tap-finished); see differences below.\n\n[![npm status](http://img.shields.io/npm/v/tap-completed.svg)](https://www.npmjs.org/package/tap-completed)\n[![node](https://img.shields.io/node/v/tap-completed.svg)](https://www.npmjs.org/package/tap-completed)\n[![Test](https://img.shields.io/github/actions/workflow/status/vweevers/tap-completed/test.yml?label=test)](https://github.com/vweevers/tap-completed/actions/workflows/test.yml)\n[![Standard](https://img.shields.io/badge/standard-informational?logo=javascript\u0026logoColor=fff)](https://standardjs.com)\n[![Common Changelog](https://common-changelog.org/badge.svg)](https://common-changelog.org)\n\n## Usage\n\n```js\nconst completed = require('tap-completed')\n\nconst ws = completed(function (results) {\n  console.log(results)\n})\n\nws.write('TAP version 13')\nws.write('# my test')\nws.write('ok 1 hello world')\nws.write('ok 2 should be equal')\nws.write('1..2')\n```\n\n## Differences from `tap-finished`\n\n- Upgraded `tap-parser` from 0.2.0 to 18\n- Incorporates a fix by Julian Gruber ([substack/tap-finished#6](https://github.com/substack/tap-finished/pull/6))\n- The `wait` period (see below) resets on a new incoming line.\n\n## API\n\n### `ws = completed([options][, callback])`\n\nReturns a writable stream that consumes TAP. The callback will be called with the `results` from `tap-parser`, equivalent to:\n\n```js\nconst completed = require('tap-completed')\nconst ws = completed().on('complete', callback)\n```\n\nOptions:\n\n- `wait` (number, default 1000): how long to wait for more output (like diagnostics) after the end was detected.\n\nThe stream is unfortunately not compatible with Node.js streams; it's best to treat it as its own interface and to read the source.\n\n## Install\n\nWith [npm](https://npmjs.org) do:\n\n```\nnpm install tap-completed\n```\n\n## License\n\n[MIT](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvweevers%2Ftap-completed","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvweevers%2Ftap-completed","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvweevers%2Ftap-completed/lists"}