{"_id":"@ljharb/through","_rev":"3957276","name":"@ljharb/through","description":"simplified stream construction","dist-tags":{"latest":"2.3.14"},"maintainers":[{"name":"ljharb","email":""}],"time":{"modified":"2025-09-01T01:42:23.000Z","created":"2023-07-18T06:08:08.330Z","2.3.14":"2025-02-08T05:28:52.320Z","2.3.13":"2024-03-09T06:20:16.460Z","2.3.12":"2024-01-25T07:25:02.660Z","2.3.11":"2023-10-11T15:44:04.309Z","2.3.10":"2023-10-11T06:01:21.978Z","2.3.9":"2023-07-18T06:08:08.330Z"},"users":{},"author":{"name":"Dominic Tarr","email":"dominic.tarr@gmail.com","url":"dominictarr.com"},"repository":{"type":"git","url":"git+https://github.com/ljharb/through.git"},"versions":{"2.3.14":{"name":"@ljharb/through","version":"2.3.14","description":"simplified stream construction","main":"index.js","types":"./through.d.ts","sideEffects":false,"scripts":{"prepack":"npmignore --auto --commentLines=autogenerated","prepublishOnly":"safe-publish-latest","prepublish":"not-in-publish || npm run prepublishOnly","lint":"eslint --ext=js,mjs .","postlint":"tsc && attw -P","pretest":"npm run lint","tests-only":"nyc tape 'test/**/*.js'","test":"npm run tests-only","posttest":"npx npm@\">= 10.2\" audit --production","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)\")\""},"dependencies":{"call-bind":"^1.0.8"},"devDependencies":{"@arethetypeswrong/cli":"^0.17.3","@ljharb/eslint-config":"^21.1.1","@ljharb/tsconfig":"^0.2.3","@types/call-bind":"^1.0.5","@types/node":"^0.12.25","@types/tape":"^5.8.1","auto-changelog":"^2.5.0","encoding":"^0.1.13","eslint":"=8.8.0","from":"^0.1.7","in-publish":"^2.0.1","npmignore":"^0.3.1","nyc":"^10.3.2","safe-publish-latest":"^2.0.0","stream-spec":"^0.3.6","tape":"^5.9.0","typescript":"next"},"keywords":["stream","streams","user-streams","pipe"],"author":{"name":"Dominic Tarr","email":"dominic.tarr@gmail.com","url":"dominictarr.com"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/ljharb/through.git"},"homepage":"https://github.com/ljharb/through","testling":{"files":"test/*.js"},"engines":{"node":">= 0.4"},"auto-changelog":{"output":"CHANGELOG.md","template":"keepachangelog","unreleased":false,"commitLimit":false,"backfillLimit":false,"hideCredit":true,"startingVersion":"2.3.9"},"publishConfig":{"ignore":[".github/workflows"]},"_id":"@ljharb/through@2.3.14","gitHead":"66623a329608e3d918207edc678f47269424846b","bugs":{"url":"https://github.com/ljharb/through/issues"},"_nodeVersion":"23.7.0","_npmVersion":"10.9.2","dist":{"shasum":"a5df44295f44dc23bfe106af59426dd0677760b1","size":10861,"noattachment":false,"key":"/@ljharb/through/-/@ljharb/through-2.3.14.tgz","tarball":"http://registry.cnpm.dingdandao.com/@ljharb/through/download/@ljharb/through-2.3.14.tgz"},"_npmUser":{"name":"ljharb","email":"ljharb@gmail.com"},"directories":{},"maintainers":[{"name":"ljharb","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/through_2.3.14_1738992532127_0.6154772206133656"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2025-02-08T05:28:52.320Z","publish_time":1738992532320,"_source_registry_name":"default","_cnpm_publish_time":1738992532320},"2.3.13":{"name":"@ljharb/through","version":"2.3.13","description":"simplified stream construction","main":"index.js","types":"./through.d.ts","sideEffects":false,"scripts":{"prepack":"npmignore --auto --commentLines=autogenerated","prepublishOnly":"safe-publish-latest","prepublish":"not-in-publish || npm run prepublishOnly","lint":"eslint --ext=js,mjs .","postlint":"npm run tsc","tsc":"tsc -p .","posttsc":"attw --pack","pretest":"npm run lint","tests-only":"nyc tape 'test/**/*.js'","test":"npm run tests-only","posttest":"aud --production","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)\")\""},"dependencies":{"call-bind":"^1.0.7"},"devDependencies":{"@arethetypeswrong/cli":"^0.13.10","@ljharb/eslint-config":"^21.1.0","@ljharb/tsconfig":"^0.1.1","@types/call-bind":"^1.0.5","@types/node":"^20.11.25","aud":"^2.0.4","auto-changelog":"^2.4.0","eslint":"=8.8.0","from":"^0.1.7","in-publish":"^2.0.1","npmignore":"^0.3.1","nyc":"^10.3.2","safe-publish-latest":"^2.0.0","stream-spec":"^0.3.6","tape":"^5.7.5","typescript":"next"},"keywords":["stream","streams","user-streams","pipe"],"author":{"name":"Dominic Tarr","email":"dominic.tarr@gmail.com","url":"dominictarr.com"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/ljharb/through.git"},"homepage":"https://github.com/ljharb/through","testling":{"files":"test/*.js"},"engines":{"node":">= 0.4"},"auto-changelog":{"output":"CHANGELOG.md","template":"keepachangelog","unreleased":false,"commitLimit":false,"backfillLimit":false,"hideCredit":true,"startingVersion":"2.3.9"},"publishConfig":{"ignore":[".github/workflows"]},"_id":"@ljharb/through@2.3.13","gitHead":"6e062a04c4acbf479a861bf6767f908c7c3197bf","bugs":{"url":"https://github.com/ljharb/through/issues"},"_nodeVersion":"21.7.0","_npmVersion":"10.5.0","dist":{"shasum":"b7e4766e0b65aa82e529be945ab078de79874edc","size":10560,"noattachment":false,"key":"/@ljharb/through/-/@ljharb/through-2.3.13.tgz","tarball":"http://registry.cnpm.dingdandao.com/@ljharb/through/download/@ljharb/through-2.3.13.tgz"},"_npmUser":{"name":"ljharb","email":"ljharb@gmail.com"},"directories":{},"maintainers":[{"name":"ljharb","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/through_2.3.13_1709965216271_0.729424289411549"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2024-03-09T06:20:16.460Z","publish_time":1709965216460,"_source_registry_name":"default","_cnpm_publish_time":1709965216460},"2.3.12":{"name":"@ljharb/through","version":"2.3.12","description":"simplified stream construction","main":"index.js","types":"./through.d.ts","sideEffects":false,"scripts":{"prepack":"npmignore --auto --commentLines=autogenerated","prepublishOnly":"safe-publish-latest","prepublish":"not-in-publish || npm run prepublishOnly","lint":"eslint --ext=js,mjs .","postlint":"npm run tsc","tsc":"tsc -p .","posttsc":"attw --pack","pretest":"npm run lint","tests-only":"nyc tape 'test/**/*.js'","test":"npm run tests-only","posttest":"aud --production","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)\")\""},"dependencies":{"call-bind":"^1.0.5"},"devDependencies":{"@arethetypeswrong/cli":"^0.13.6","@ljharb/eslint-config":"^21.1.0","@types/call-bind":"^1.0.5","aud":"^2.0.4","auto-changelog":"^2.4.0","eslint":"=8.8.0","from":"^0.1.7","in-publish":"^2.0.1","npmignore":"^0.3.1","nyc":"^10.3.2","safe-publish-latest":"^2.0.0","stream-spec":"^0.3.6","tape":"^5.7.4","typescript":"^5.4.0-dev.20240124"},"keywords":["stream","streams","user-streams","pipe"],"author":{"name":"Dominic Tarr","email":"dominic.tarr@gmail.com","url":"dominictarr.com"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/ljharb/through.git"},"homepage":"https://github.com/ljharb/through","testling":{"files":"test/*.js"},"engines":{"node":">= 0.4"},"auto-changelog":{"output":"CHANGELOG.md","template":"keepachangelog","unreleased":false,"commitLimit":false,"backfillLimit":false,"hideCredit":true,"startingVersion":"2.3.9"},"publishConfig":{"ignore":[".github/workflows"]},"_id":"@ljharb/through@2.3.12","gitHead":"c935943840d1d67902cf73a76390a36f9d283f7a","bugs":{"url":"https://github.com/ljharb/through/issues"},"_nodeVersion":"21.6.0","_npmVersion":"10.2.4","dist":{"shasum":"c418c43060eee193adce48b15c2206096a28e9ea","size":13039,"noattachment":false,"key":"/@ljharb/through/-/@ljharb/through-2.3.12.tgz","tarball":"http://registry.cnpm.dingdandao.com/@ljharb/through/download/@ljharb/through-2.3.12.tgz"},"_npmUser":{"name":"ljharb","email":"ljharb@gmail.com"},"directories":{},"maintainers":[{"name":"ljharb","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/through_2.3.12_1706167502482_0.34711960442663226"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2024-01-25T07:25:02.660Z","publish_time":1706167502660,"_source_registry_name":"default","_cnpm_publish_time":1706167502660},"2.3.11":{"name":"@ljharb/through","version":"2.3.11","description":"simplified stream construction","main":"index.js","scripts":{"prepack":"npmignore --auto --commentLines=autogenerated","prepublishOnly":"safe-publish-latest","prepublish":"not-in-publish || npm run prepublishOnly","lint":"eslint --ext=js,mjs .","pretest":"npm run lint","tests-only":"nyc tape 'test/**/*.js'","test":"npm run tests-only","posttest":"aud --production","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)\")\""},"dependencies":{"call-bind":"^1.0.2"},"devDependencies":{"@ljharb/eslint-config":"^21.1.0","aud":"^2.0.3","auto-changelog":"^2.4.0","eslint":"=8.8.0","from":"^0.1.7","in-publish":"^2.0.1","npmignore":"^0.3.0","nyc":"^10.3.2","safe-publish-latest":"^2.0.0","stream-spec":"^0.3.6","tape":"^5.7.0"},"keywords":["stream","streams","user-streams","pipe"],"author":{"name":"Dominic Tarr","email":"dominic.tarr@gmail.com","url":"dominictarr.com"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/ljharb/through.git"},"homepage":"https://github.com/ljharb/through","testling":{"files":"test/*.js"},"engines":{"node":">= 0.4"},"auto-changelog":{"output":"CHANGELOG.md","template":"keepachangelog","unreleased":false,"commitLimit":false,"backfillLimit":false,"hideCredit":true,"startingVersion":"2.3.9"},"publishConfig":{"ignore":[".github/workflows"]},"_id":"@ljharb/through@2.3.11","gitHead":"064cf5c449df7ccbeeddb4ceb5464be37c8a7e81","bugs":{"url":"https://github.com/ljharb/through/issues"},"_nodeVersion":"20.8.0","_npmVersion":"10.1.0","dist":{"shasum":"783600ff12c06f21a76cc26e33abd0b1595092f9","size":9059,"noattachment":false,"key":"/@ljharb/through/-/@ljharb/through-2.3.11.tgz","tarball":"http://registry.cnpm.dingdandao.com/@ljharb/through/download/@ljharb/through-2.3.11.tgz"},"_npmUser":{"name":"ljharb","email":"ljharb@gmail.com"},"directories":{},"maintainers":[{"name":"ljharb","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/through_2.3.11_1697039044064_0.10156813249374386"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2023-10-11T15:44:04.309Z","publish_time":1697039044309,"_source_registry_name":"default","_cnpm_publish_time":1697039044309},"2.3.10":{"name":"@ljharb/through","version":"2.3.10","description":"simplified stream construction","main":"index.js","scripts":{"prepack":"npmignore --auto --commentLines=autogenerated","prepublishOnly":"safe-publish-latest","prepublish":"not-in-publish || npm run prepublishOnly","lint":"eslint --ext=js,mjs .","pretest":"npm run lint","tests-only":"nyc tape 'test/**/*.js'","test":"npm run tests-only","posttest":"aud --production","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)\")\""},"devDependencies":{"@ljharb/eslint-config":"^21.1.0","aud":"^2.0.3","auto-changelog":"^2.4.0","eslint":"=8.8.0","from":"^0.1.7","in-publish":"^2.0.1","npmignore":"^0.3.0","nyc":"^10.3.2","safe-publish-latest":"^2.0.0","stream-spec":"^0.3.6","tape":"^5.7.0"},"keywords":["stream","streams","user-streams","pipe"],"author":{"name":"Dominic Tarr","email":"dominic.tarr@gmail.com","url":"dominictarr.com"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/ljharb/through.git"},"homepage":"https://github.com/ljharb/through","testling":{"files":"test/*.js"},"engines":{"node":">= 0.4"},"auto-changelog":{"output":"CHANGELOG.md","template":"keepachangelog","unreleased":false,"commitLimit":false,"backfillLimit":false,"hideCredit":true,"startingVersion":"2.3.9"},"publishConfig":{"ignore":[".github/workflows"]},"_id":"@ljharb/through@2.3.10","gitHead":"daaf09d0b18a35fdd49dc16f256ad1afb3d31467","bugs":{"url":"https://github.com/ljharb/through/issues"},"_nodeVersion":"20.8.0","_npmVersion":"10.1.0","dist":{"shasum":"f95970e34d54125b50d0a17397e6c861e60a5881","size":8999,"noattachment":false,"key":"/@ljharb/through/-/@ljharb/through-2.3.10.tgz","tarball":"http://registry.cnpm.dingdandao.com/@ljharb/through/download/@ljharb/through-2.3.10.tgz"},"_npmUser":{"name":"ljharb","email":"ljharb@gmail.com"},"directories":{},"maintainers":[{"name":"ljharb","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/through_2.3.10_1697004081794_0.6707810032575381"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2023-10-11T06:01:21.978Z","publish_time":1697004081978,"_source_registry_name":"default","_cnpm_publish_time":1697004081978},"2.3.9":{"name":"@ljharb/through","version":"2.3.9","description":"simplified stream construction","main":"index.js","scripts":{"prepack":"npmignore --auto --commentLines=autogenerated","prepublishOnly":"safe-publish-latest","prepublish":"not-in-publish || npm run prepublishOnly","lint":"eslint --ext=js,mjs .","pretest":"npm run lint","tests-only":"nyc tape 'test/**/*.js'","test":"npm run tests-only","posttest":"aud --production","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)\")\""},"devDependencies":{"@ljharb/eslint-config":"^21.1.0","aud":"^2.0.2","auto-changelog":"^2.4.0","eslint":"=8.8.0","from":"^0.1.7","in-publish":"^2.0.1","npmignore":"^0.3.0","nyc":"^10.3.2","safe-publish-latest":"^2.0.0","stream-spec":"^0.3.6","tape":"^5.6.5"},"keywords":["stream","streams","user-streams","pipe"],"author":{"name":"Dominic Tarr","email":"dominic.tarr@gmail.com","url":"dominictarr.com"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/ljharb/through.git"},"homepage":"https://github.com/ljharb/through","testling":{"files":"test/*.js"},"engines":{"node":">= 0.4"},"auto-changelog":{"output":"CHANGELOG.md","template":"keepachangelog","unreleased":false,"commitLimit":false,"backfillLimit":false,"hideCredit":true,"startingVersion":"2.3.9"},"publishConfig":{"ignore":[".github/workflows"]},"gitHead":"ba67795a8d34a5a0f3d34604ac6922f24878ff69","bugs":{"url":"https://github.com/ljharb/through/issues"},"_id":"@ljharb/through@2.3.9","_nodeVersion":"20.4.0","_npmVersion":"9.7.2","dist":{"shasum":"85f221eb82f9d555e180e87d6e50fb154af85408","size":8870,"noattachment":false,"key":"/@ljharb/through/-/@ljharb/through-2.3.9.tgz","tarball":"http://registry.cnpm.dingdandao.com/@ljharb/through/download/@ljharb/through-2.3.9.tgz"},"_npmUser":{"name":"ljharb","email":"ljharb@gmail.com"},"directories":{},"maintainers":[{"name":"ljharb","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/through_2.3.9_1689660488081_0.3310093821904456"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2023-07-18T06:08:08.330Z","publish_time":1689660488330,"_source_registry_name":"default","_cnpm_publish_time":1689660488330}},"readme":"# @ljharb/through <sup>[![Version Badge][npm-version-svg]][package-url]</sup>\n\n*Note*: This package is a fork of https://npmjs.com/through, and builds off of it.\n\n[![github actions][actions-image]][actions-url]\n[![coverage][codecov-image]][codecov-url]\n[![License][license-image]][license-url]\n[![Downloads][downloads-image]][downloads-url]\n\n[![npm badge][npm-badge-png]][package-url]\n\nEasy way to create a `Stream` that is both `readable` and `writable`.\n\n* Pass in optional `write` and `end` methods.\n* `through` takes care of pause/resume logic if you use `this.queue(data)` instead of `this.emit('data', data)`.\n* Use `this.pause()` and `this.resume()` to manage flow.\n* Check `this.paused` to see current flow state. (`write` always returns `!this.paused`).\n\nThis function is the basis for most of the synchronous streams in [event-stream](http://github.com/dominictarr/event-stream).\n\n``` js\nvar through = require('@ljharb/through')\n\nthrough(function write(data) {\n    this.queue(data) //data *must* not be null\n  },\n  function end () { //optional\n    this.queue(null)\n  })\n```\n\nOr, can also be used _without_ buffering on pause, use `this.emit('data', data)`,\nand this.emit('end')\n\n``` js\nvar through = require('@ljharb/through')\n\nthrough(function write(data) {\n    this.emit('data', data)\n    //this.pause()\n  },\n  function end () { //optional\n    this.emit('end')\n  })\n```\n\n## Extended Options\n\nYou will probably not need these 99% of the time.\n\n### autoDestroy=false\n\nBy default, `through` emits close when the writable\nand readable side of the stream has ended.\nIf that is not desired, set `autoDestroy=false`.\n\n``` js\nvar through = require('@ljharb/through')\n\n//like this\nvar ts = through(write, end, {autoDestroy: false})\n//or like this\nvar ts = through(write, end)\nts.autoDestroy = false\n```\n\n[package-url]: https://npmjs.org/package/@ljharb/through\n[npm-version-svg]: https://versionbadg.es/ljharb/through.svg\n[deps-svg]: https://david-dm.org/ljharb/through.svg\n[deps-url]: https://david-dm.org/ljharb/through\n[dev-deps-svg]: https://david-dm.org/ljharb/through/dev-status.svg\n[dev-deps-url]: https://david-dm.org/ljharb/through#info=devDependencies\n[npm-badge-png]: https://nodei.co/npm/@ljharb/through.png?downloads=true&stars=true\n[license-image]: https://img.shields.io/npm/l/@ljharb/through.svg\n[license-url]: LICENSE\n[downloads-image]: https://img.shields.io/npm/dm/@ljharb/through.svg\n[downloads-url]: https://npm-stat.com/charts.html?package=@ljharb/through\n[codecov-image]: https://codecov.io/gh/ljharb/through/branch/main/graphs/badge.svg\n[codecov-url]: https://app.codecov.io/gh/ljharb/through/\n[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/ljharb/through\n[actions-url]: https://github.com/ljharb/through/actions\n","_attachments":{},"homepage":"https://github.com/ljharb/through","bugs":{"url":"https://github.com/ljharb/through/issues"},"license":"MIT"}