{"_id":"p-break","_rev":"6-e2fbec3c5886ebd75dd219e1804b40fd","name":"p-break","description":"Break out of a promise chain","dist-tags":{"latest":"2.0.0"},"versions":{"0.1.0":{"name":"p-break","version":"0.1.0","description":"Break out of a promise chain","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/p-break.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=4"},"scripts":{"test":"xo && ava"},"files":["index.js"],"keywords":["promise","break","chain","out","return","early","if","conditional","error","thunk","function","async","await","promises","combinator","bluebird"],"devDependencies":{"ava":"*","xo":"*"},"xo":{"esnext":true},"gitHead":"91bb0ede466535612b9d4e3841c7228e6460a2eb","bugs":{"url":"https://github.com/sindresorhus/p-break/issues"},"homepage":"https://github.com/sindresorhus/p-break#readme","_id":"p-break@0.1.0","_shasum":"367940ba41633633040ce06bf4167ee865fbffe3","_from":".","_npmVersion":"3.10.8","_nodeVersion":"6.9.1","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"367940ba41633633040ce06bf4167ee865fbffe3","tarball":"https://registry.npmjs.org/p-break/-/p-break-0.1.0.tgz","integrity":"sha512-xPGUUZo/vHBikjrYxN68WX9v8bnR04c2alrs842F1OwysV027pdPKJJpY8YPQNpaP55mnOhQMa4MeBq9EM8hfA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCpcGCqylDdXdqRfgQIhRLA/RHlkifWeAZ3MaUAENj6PgIhAK9pHZx+4J5aFwsWH/u+hESVNpzqbupX+Db7hVWWmeUH"}]},"maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/p-break-0.1.0.tgz_1478859137650_0.5503299010451883"},"directories":{}},"1.0.0":{"name":"p-break","version":"1.0.0","description":"Break out of a promise chain","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/p-break.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=4"},"scripts":{"test":"xo && ava"},"files":["index.js"],"keywords":["promise","break","chain","out","return","early","if","conditional","error","thunk","function","async","await","promises","combinator","bluebird"],"devDependencies":{"ava":"*","xo":"*"},"gitHead":"cc6675a425b54ec204913ef5ea731eddae74c905","bugs":{"url":"https://github.com/sindresorhus/p-break/issues"},"homepage":"https://github.com/sindresorhus/p-break#readme","_id":"p-break@1.0.0","_npmVersion":"5.4.2","_nodeVersion":"8.7.0","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"integrity":"sha512-hZ/dcgAW3d3xuevbjbdYXQkARRcubPdFwHmJU7bJHB1AiAGuIsEREYuZ9UBvoyNKcDmdMFGIHeR9YeaLIDkCCg==","shasum":"89735a5d19d4814ac91e81b8a63ddeecf8bd7a92","tarball":"https://registry.npmjs.org/p-break/-/p-break-1.0.0.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBWfGuuTLFtGc392WSLEHAVgNZ6lLqUlcYX2oUZR9I5LAiAmg2p+9AQu4p/UgCr2TRiyqOxz2jQCMfWE6M/IePxXRg=="}]},"maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/p-break-1.0.0.tgz_1509728502357_0.47032765322364867"},"directories":{}},"2.0.0":{"name":"p-break","version":"2.0.0","description":"Break out of a promise chain","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/p-break.git"},"funding":"https://github.com/sponsors/sindresorhus","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"type":"module","exports":"./index.js","engines":{"node":">=12"},"scripts":{"test":"xo && ava"},"keywords":["promise","break","chain","out","return","early","if","conditional","error","thunk","function","async","await","promises","combinator","bluebird"],"devDependencies":{"ava":"^3.15.0","xo":"^0.38.2"},"gitHead":"f8bedb45f40f5f4aa42c9c49a2a248b15ffd2fd2","bugs":{"url":"https://github.com/sindresorhus/p-break/issues"},"homepage":"https://github.com/sindresorhus/p-break#readme","_id":"p-break@2.0.0","_nodeVersion":"12.20.1","_npmVersion":"6.14.10","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"integrity":"sha512-ITBYBUF9Z/MnJIhnHfoNuemxJby5q2+P2Q1OpbEdd6I7eP7dx9Pt3cercVB9ZoP4S3Vlk2C2Eant4d3ZLrOApw==","shasum":"b83cb3465992fc40899e7bcd0a0c1076039cfcb1","tarball":"https://registry.npmjs.org/p-break/-/p-break-2.0.0.tgz","fileCount":4,"unpackedSize":3255,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgbV9WCRA9TVsSAnZWagAAS80P+gNJ8fm7BA5ntTXwrDYR\nemlLpAcHr/6Ye4zrouvB/7hr1GOAUuqzbpb0qxLcOOLDz2jumCJfHRsErtbr\nxZZa5CUHwavsJ9/afHiJISTbR8QjYu4Dci2S950F+LxkP2rUl+F1AoTtdd5R\ndUjLOwaV1z7XxK9HnFwQ06fXYAHd8AWD/b+uvkiq83pkCdNa6s3uKCXD9P/B\n6qOLuRRTVMpa0as0IfQ0znqF6Ltlg/BXNE3uCnnvT9MF61Z6IQzE8Sfq8I0v\nY5ZH1NHzN9kDpbLyglpsLQeJZcefx+2zk3lgJU6d8veeaKJiOF83r8YlnEKT\naLqT28hn+WdtsOPuvHE0PUSbzxW+WwH6qQoa8p+visp0x3QWsc75biogH4Eq\n283u7z5hQO+hhDU6pbapFNaXsqp3CjiMOkKipBBYFp9g9Yh24PZdd3IlvN0b\nrj8SYsWmmWKU28tYmlqbnse9JWru3lbUP6OthQnzbEbG5hhJSVLq17JoCui+\ngyjEswzJ3KkGtf9E6fmJLUENbH6wboYME4JoUSlrH+hzHmPgR1DaAQw/8Pcs\nufRyQIu2oh81oihFLC88tIo4CtPFYrnCiBIcn5EwIO64AoePmSspeVxM0aq2\nMQ5BoGKONh62hjJilzH9ETpP3Cgv1tebDsBHBGsLHDx4L4tSwKrANtJi8nTX\n+iXL\r\n=+Lla\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIErEyvUTEdmRG9aFUxFr2fwxwEy2lh5U4X+I44nE1ec9AiEA2VpZS7GlIkyNz9pFJqDDEBV80aSf0X/oH/ODNZwliwc="}]},"directories":{},"maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/p-break_2.0.0_1617780566331_0.13255230043185096"},"_hasShrinkwrap":false}},"readme":"# p-break\n\n> Break out of a promise chain\n\nSee [\"How do I break out of a promise chain?\"](https://github.com/sindresorhus/promise-fun#how-do-i-break-out-of-a-promise-chain) for a better way.\n\n## Install\n\n```\n$ npm install p-break\n```\n\n## Usage\n\nHere the `onlyRunConditional` promises are skipped if `conditional` is falsy:\n\n```js\nimport pBreak from 'p-break';\n\nalwaysRun1()\n\t.then(() => alwaysRun2())\n\t.then(conditional => conditional || pBreak('🦄'))\n\t.then(() => onlyRunConditional1())\n\t.then(() => onlyRunConditional2())\n\t.then(() => onlyRunConditional3())\n\t.then(() => onlyRunConditional4())\n\t.catch(pBreak.end)\n\t.then(console.log);\n\t//=> '🦄'\n```\n\n## API\n\n### pBreak([value])\n\nStarts the break. Any `.then()`'s between here and `pBreak.end()` are skipped.\n\n### value\n\nValue to pass down the chain after `pBreak.end()`.\n\n### pBreak.end\n\nEnds the break. Make sure not to have any other `.catch()` handlers between `pBreak()` and here.\n\n## Related\n\n- [p-if](https://github.com/sindresorhus/p-if) - Conditional promise chains\n- [More…](https://github.com/sindresorhus/promise-fun)\n","maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"time":{"modified":"2022-06-23T05:42:24.471Z","created":"2016-11-11T10:12:17.892Z","0.1.0":"2016-11-11T10:12:17.892Z","1.0.0":"2017-11-03T17:01:42.584Z","2.0.0":"2021-04-07T07:29:26.501Z"},"homepage":"https://github.com/sindresorhus/p-break#readme","keywords":["promise","break","chain","out","return","early","if","conditional","error","thunk","function","async","await","promises","combinator","bluebird"],"repository":{"type":"git","url":"git+https://github.com/sindresorhus/p-break.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"bugs":{"url":"https://github.com/sindresorhus/p-break/issues"},"license":"MIT","readmeFilename":"readme.md"}