{"_id":"pull-catch","_rev":"4634844","name":"pull-catch","description":"Catch errors in a pull stream","dist-tags":{"latest":"1.1.0"},"maintainers":[{"name":"nichoth","email":"nichoth@gmail.com"}],"time":{"modified":"2026-04-10T19:11:25.000Z","created":"2016-11-26T22:59:01.662Z","1.1.0":"2023-10-27T19:59:52.432Z","1.0.1":"2019-01-10T17:26:46.202Z","1.0.0":"2016-12-20T17:53:50.463Z","0.0.2":"2016-11-27T02:44:36.171Z","0.0.1":"2016-11-27T02:43:46.800Z","0.0.0":"2016-11-26T22:59:01.662Z"},"users":{},"author":{"name":"nichoth"},"repository":{"type":"git","url":"git+https://github.com/nichoth/pull-catch.git"},"versions":{"1.1.0":{"name":"pull-catch","version":"1.1.0","description":"Catch errors in a pull stream","main":"index.js","scripts":{"preversion":"npm test","postversion":"git push && git push --tags && npm publish","test":"node test/index.js | tap-arc"},"devDependencies":{"pull-stream":"^3.5.0","tap-arc":"^1.2.0","tape":"^5.7.2"},"repository":{"type":"git","url":"git+https://github.com/nichoth/pull-catch.git"},"keywords":["pull","stream","pull-stream","error","catch"],"author":{"name":"nichoth"},"license":"ISC","bugs":{"url":"https://github.com/nichoth/pull-catch/issues"},"homepage":"https://github.com/nichoth/pull-catch#readme","_id":"pull-catch@1.1.0","gitHead":"55ca93c84d404203d3df3b8de09ea26946a55616","_nodeVersion":"20.8.0","_npmVersion":"10.1.0","dist":{"shasum":"e1a19c1651b63145187501e5e67381f6a49de854","size":1246,"noattachment":false,"key":"/pull-catch/-/pull-catch-1.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/pull-catch/download/pull-catch-1.1.0.tgz"},"_npmUser":{"name":"nichoth","email":"nichoth@gmail.com"},"directories":{},"maintainers":[{"name":"nichoth","email":"nichoth@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/pull-catch_1.1.0_1698436792245_0.7729168825988002"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2023-10-27T19:59:52.432Z","publish_time":1698436792432,"_source_registry_name":"default","_cnpm_publish_time":1698436792432},"1.0.1":{"name":"pull-catch","version":"1.0.1","description":"Catch errors in a pull stream","main":"index.js","scripts":{"preversion":"npm test","postversion":"git push && git push --tags && npm publish","test":"node test/index.js | tap-spec"},"devDependencies":{"pull-stream":"^3.5.0","tap-spec":"^4.1.1","tape":"^4.6.3"},"repository":{"type":"git","url":"git+https://github.com/nichoth/pull-catch.git"},"keywords":["pull","stream","pull-stream","error","catch"],"author":{"name":"nichoth"},"license":"ISC","bugs":{"url":"https://github.com/nichoth/pull-catch/issues"},"homepage":"https://github.com/nichoth/pull-catch#readme","gitHead":"60de2b9fb2dec2c84f3814d4f1769f3ad6d16b28","_id":"pull-catch@1.0.1","_npmVersion":"6.5.0","_nodeVersion":"10.9.0","_npmUser":{"name":"nichoth","email":"nichoth@gmail.com"},"dist":{"shasum":"61be4d3d4184436a89994bec975f1ff4aea854cb","size":1251,"noattachment":false,"key":"/pull-catch/-/pull-catch-1.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/pull-catch/download/pull-catch-1.0.1.tgz"},"maintainers":[{"name":"nichoth","email":"nichoth@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/pull-catch_1.0.1_1547141206088_0.5612364729585348"},"_hasShrinkwrap":false,"publish_time":1547141206202,"_cnpm_publish_time":1547141206202,"_cnpmcore_publish_time":"2021-12-16T11:26:41.308Z"},"1.0.0":{"name":"pull-catch","version":"1.0.0","description":"Catch errors in a pull stream","main":"index.js","scripts":{"preversion":"npm test","postversion":"git push && git push --tags && npm publish","test":"node test/index.js | tap-spec"},"devDependencies":{"pull-stream":"^3.5.0","tap-spec":"^4.1.1","tape":"^4.6.3"},"repository":{"type":"git","url":"git+https://github.com/nichoth/pull-catch.git"},"keywords":["pull","stream","pull-stream","error","catch"],"author":{"name":"nichoth"},"license":"ISC","bugs":{"url":"https://github.com/nichoth/pull-catch/issues"},"homepage":"https://github.com/nichoth/pull-catch#readme","gitHead":"efc2e62c5a2f2d59b0cd8aae4136b4a55815cb59","_id":"pull-catch@1.0.0","_shasum":"f58037eb5c282ccb506af9f76b0027d33931e48b","_from":".","_npmVersion":"3.9.2","_nodeVersion":"4.4.4","_npmUser":{"name":"nichoth","email":"nichoth@gmail.com"},"dist":{"shasum":"f58037eb5c282ccb506af9f76b0027d33931e48b","size":2147,"noattachment":false,"key":"/pull-catch/-/pull-catch-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/pull-catch/download/pull-catch-1.0.0.tgz"},"maintainers":[{"name":"nichoth","email":"nichoth@gmail.com"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/pull-catch-1.0.0.tgz_1482256428529_0.6860309180337936"},"directories":{},"publish_time":1482256430463,"_hasShrinkwrap":false,"_cnpm_publish_time":1482256430463,"_cnpmcore_publish_time":"2021-12-16T11:26:41.483Z"},"0.0.2":{"name":"pull-catch","version":"0.0.2","description":"Catch errors in a pull stream","main":"index.js","scripts":{"preversion":"npm test","postversion":"git push && git push --tags && npm publish","test":"node test/index.js | tap-spec"},"devDependencies":{"pull-stream":"^3.5.0","tap-spec":"^4.1.1","tape":"^4.6.3"},"repository":{"type":"git","url":"git+https://github.com/nichoth/pull-catch.git"},"keywords":["pull","stream","pull-stream","error","catch"],"author":{"name":"nichoth"},"license":"ISC","bugs":{"url":"https://github.com/nichoth/pull-catch/issues"},"homepage":"https://github.com/nichoth/pull-catch#readme","gitHead":"2217111ed7a471cd56be23992b86d3a4330f76f5","_id":"pull-catch@0.0.2","_shasum":"464fda646531966867494f6378988cd21815da93","_from":".","_npmVersion":"3.9.2","_nodeVersion":"4.4.4","_npmUser":{"name":"nichoth","email":"nichoth@gmail.com"},"dist":{"shasum":"464fda646531966867494f6378988cd21815da93","size":2143,"noattachment":false,"key":"/pull-catch/-/pull-catch-0.0.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/pull-catch/download/pull-catch-0.0.2.tgz"},"maintainers":[{"name":"nichoth","email":"nichoth@gmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/pull-catch-0.0.2.tgz_1480214675944_0.5910357548855245"},"directories":{},"publish_time":1480214676171,"_hasShrinkwrap":false,"_cnpm_publish_time":1480214676171,"_cnpmcore_publish_time":"2021-12-16T11:26:41.702Z"},"0.0.1":{"name":"pull-catch","version":"0.0.1","description":"Catch errors in a pull stream","main":"index.js","scripts":{"preversion":"npm test","postversion":"git push && git push --tags && npm publish","test":"node test/index.js | tap-spec"},"devDependencies":{"pull-stream":"^3.5.0","tap-spec":"^4.1.1","tape":"^4.6.3"},"repository":{"type":"git","url":"git+https://github.com/nichoth/pull-catch.git"},"keywords":["pull","stream","pull-stream","error","catch"],"author":{"name":"nichoth"},"license":"ISC","bugs":{"url":"https://github.com/nichoth/pull-catch/issues"},"homepage":"https://github.com/nichoth/pull-catch#readme","gitHead":"c86d4c35233e9efb6ad303bbcd5c0ac5c8737a21","_id":"pull-catch@0.0.1","_shasum":"c0eaa7c9da12afd88b727fa3eddcf7a6db2a2b8a","_from":".","_npmVersion":"3.9.2","_nodeVersion":"4.4.4","_npmUser":{"name":"nichoth","email":"nichoth@gmail.com"},"dist":{"shasum":"c0eaa7c9da12afd88b727fa3eddcf7a6db2a2b8a","size":2146,"noattachment":false,"key":"/pull-catch/-/pull-catch-0.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/pull-catch/download/pull-catch-0.0.1.tgz"},"maintainers":[{"name":"nichoth","email":"nichoth@gmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/pull-catch-0.0.1.tgz_1480214626581_0.7380757485516369"},"directories":{},"publish_time":1480214626800,"_hasShrinkwrap":false,"_cnpm_publish_time":1480214626800,"_cnpmcore_publish_time":"2021-12-16T11:26:41.923Z"},"0.0.0":{"name":"pull-catch","version":"0.0.0","description":"Catch errors in a pull stream","main":"index.js","scripts":{"preversion":"npm test","postversion":"git push && git push --tags && npm publish","test":"node test/index.js | tap-spec"},"devDependencies":{"pull-stream":"^3.5.0","tap-spec":"^4.1.1","tape":"^4.6.3"},"repository":{"type":"git","url":"git+https://github.com/nichoth/pull-catch.git"},"keywords":["pull","stream","pull-stream","error","catch"],"author":{"name":"nichoth"},"license":"ISC","bugs":{"url":"https://github.com/nichoth/pull-catch/issues"},"homepage":"https://github.com/nichoth/pull-catch#readme","gitHead":"e097585ae7d40eae863156767bcbd830cfdf15c3","_id":"pull-catch@0.0.0","_shasum":"bc8188d2dce687e6210d001f83ee219823487572","_from":".","_npmVersion":"3.9.2","_nodeVersion":"4.4.4","_npmUser":{"name":"nichoth","email":"nichoth@gmail.com"},"dist":{"shasum":"bc8188d2dce687e6210d001f83ee219823487572","size":2150,"noattachment":false,"key":"/pull-catch/-/pull-catch-0.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/pull-catch/download/pull-catch-0.0.0.tgz"},"maintainers":[{"name":"nichoth","email":"nichoth@gmail.com"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/pull-catch-0.0.0.tgz_1480201139690_0.020877313567325473"},"directories":{},"publish_time":1480201141662,"_hasShrinkwrap":false,"_cnpm_publish_time":1480201141662,"_cnpmcore_publish_time":"2021-12-16T11:26:42.158Z"}},"readme":"# pull catch\nHandle errors in pull streams\n\nThis is a through stream that can ensure your source stream always ends normally, even when it returns an error. This is useful if you are combining several source streams with pull-many, and you want to keep the remaining streams open even if one of them errors. \n\n## install \n\n    $ npm install pull-catch\n\n## example\n\n```js\nvar test = require('tape')\nvar S = require('pull-stream')\nvar Catch = require('../')\n\ntest('catch errors', function (t) {\n    t.plan(2)\n    S(\n        S.error(new Error('test')),\n        Catch(function onErr (err) {\n            t.equal(err.message, 'test', 'should callback with error')\n        }),\n        S.collect(function (err, resp) {\n            t.error(err, 'should end the stream without error')\n        })\n    )\n})\n\ntest('return false to pass error', function (t) {\n    t.plan(1)\n    S(\n        S.error(new Error('test')),\n        Catch(function (err) {\n            return false\n        }),\n        S.collect(function (err, res) {\n            t.equal(err.message, 'test', 'should pass error in stream')\n        })\n    )\n})\n\ntest('return truthy to emit one event then end', function (t) {\n    t.plan(2)\n    S(\n        S.error(new Error('test')),\n        Catch(function (err) {\n            return 'test data'\n        }),\n        S.collect(function (err, res) {\n            t.error(err, 'should not end with error')\n            t.deepEqual(res, ['test data'], 'should emit one event')\n        })\n    )\n})\n\ntest('callback is optional', function (t) {\n    t.plan(1)\n    S(\n        S.error(new Error('test')),\n        Catch(),\n        S.collect(function (err, res) {\n            t.error(err, 'should end stream without error')\n        })\n    )\n})\n```\n","_attachments":{},"homepage":"https://github.com/nichoth/pull-catch#readme","bugs":{"url":"https://github.com/nichoth/pull-catch/issues"},"license":"ISC"}