{"_id":"@andimeier/promise-chain","_rev":"1-e67736f8b0d0eafcf69b8529212d4a4b","name":"@andimeier/promise-chain","dist-tags":{"latest":"0.0.1"},"versions":{"0.0.1":{"name":"@andimeier/promise-chain","version":"0.0.1","description":"flexible configuration of chained and parallel promises","main":"lib/index.js","scripts":{"test":"mocha","test-inspect":"mocha --inspect-brk"},"keywords":["promises"],"author":{"name":"Alexander Eck-Zimmer"},"license":"ISC","devDependencies":{"chai":"^4.2.0","lodash":"^4.17.11","mocha":"^6.1.4"},"gitHead":"614afc63dd896eeaf985324c115c4858cb52d0ae","_id":"@andimeier/promise-chain@0.0.1","_npmVersion":"6.4.1","_nodeVersion":"10.15.3","_npmUser":{"name":"andimeier","email":"andimeier@gmx.net"},"dist":{"integrity":"sha512-b9yf0RGtcsDAA7yh6ZjAHJuSFIb+Za562Img5DQsQGyOwJaMZsznveHyNoMFrx7+zq0Q6I3gpZoXgrBolNuF4Q==","shasum":"b0756d2b6b27bc1a0e6309d515ecef5aba4314b3","tarball":"https://registry.npmjs.org/@andimeier/promise-chain/-/promise-chain-0.0.1.tgz","fileCount":5,"unpackedSize":19530,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc2tfzCRA9TVsSAnZWagAAGpIP/jC+iNKc4CH69MdwX3GX\nak9nDQG9fISbXQCe3p7c8WagMUY/1MLz9Bn5ICpN+XO6if55Da5nrkBlIfXw\nVIyGxgTaaCtKF9PqY8Xj3EH1C2t3JeJ/qoOc568jrZu7Cc+DAfavsMqfKG/g\nrHp7gCFySWsVpnJnlrMKRdbwtwqx9yiP1hn275RhqKntD/jCgq6M8mUlhjxz\neMlJFcA3itINWlCjIhOMPUVStlBGPfyyYHc63zZzinve9Z26b7I9p7TbV4Pk\nqAVjyIJZaM/QWrShqeK10leJpIo/4rZyLa8AATZOL8yXH4neYSMpw5IwBgdN\n6ieQc3xa7ualw5lR0EdGwqq2j7ei7ZoYizfnwaQTuYpbTk+tRshl/tYlA6Vv\nr5Ts9L6m1novX6VJsELY2/kCSo9vHM1axcT+WoGLL3QQpxwFK9Nv0v0hAHoR\nwFui2acF32d6vtSP2aqHQve818VSP+6mpS0+HLv1gGt2Mi2jNEUr3yZBuSY9\nNpbzP34ea6TnQna5gN6T0/HCRl46Z3sc2cVXuPfqHyMV/14ey9ZhC8JcPeia\nms8/bPKnXncBmuNisnyOnY92HZL34jP0D/K9VE1dVON/AgIhzRDswpR7xykK\n9PsJV4GiGhPLerG5Zjmr6kBu850C1GFHz2C+veHybj17aBEYYhKqH2VVl6X9\nCjAm\r\n=hxGa\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCjToNshD7Gvss8aIVfXcloBJsiErsOK8cUKnhGhrq6/wIhAPjCNPDf7M/6VrDD/XvaNN20p5PQTcoSdJLnt9GVMPOY"}]},"maintainers":[{"name":"andimeier","email":"andimeier@gmx.net"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/promise-chain_0.0.1_1557846003314_0.7101341831409127"},"_hasShrinkwrap":false}},"time":{"created":"2019-05-14T15:00:03.279Z","0.0.1":"2019-05-14T15:00:03.421Z","modified":"2022-04-04T13:58:28.831Z"},"maintainers":[{"name":"andimeier","email":"andimeier@gmx.net"}],"description":"flexible configuration of chained and parallel promises","keywords":["promises"],"author":{"name":"Alexander Eck-Zimmer"},"license":"ISC","readme":"# Promise-chain\r\n\r\nThis lib aims to make a network of promises easily configurable. Rejection of a promise should not lead per se to an overall rejection,\r\nbut you can define an \"on reject\" handler (another promise following in the \"reject\" case). \r\n\r\n## Terminology\r\n\r\n* \"chain\" ... the chained promises\r\n* \"chain item\" ... one promise plus its metadata for linking it within the chain\r\n\r\n## Basic Usage\r\n\r\nInclude the lib in your app:\r\n\r\n```js\r\nconst promiseChain = require('promise-chain');\r\n```\r\n\r\nYou can switch on debugging output with:\r\n\r\n```js\r\nconst promiseChain = require('promise-chain');\r\npromiseChain.setDeubg(true);\r\n```\r\n\r\n## Specifying a promise chain\r\n\r\nA \"chain item\" is nothing else than a promise returning function plus a couple of properties which define the chaining behavior.\r\n\r\nRecognized properties are:\r\n\r\n* `promise` ... {function} the promise returning function\r\n* `onResolve` ... {ChainItem} the next chain item to be executed on success of the current item\r\n* `onReject` ... {ChainItem} the next chain item to be executed if the current item rejects\r\n* `name` ...{string}  an identifier string. This is used a the key for the errors object\r\n* `setError` ... {boolean} if set, a rejected promise will even be registered in the `errors` structure of the result object if \r\nit has an `onReject` successor. If false,a rejected promise with a `onReject` successor will not produce an error. A rejected promise\r\n*without* an `onReject` setting will *always* produce an error. Default is false.\r\n* `errorKey` ... {string} (optional) if set then this key will be used in the errors objects. If this property is omitted, the property `name` \r\nwill be used per default. This property should help you collecting possibly many promises in the chain into one error \"candidate\". For example, to populate input fields in a HTML form, it helps to assign several tests for one field to the one field name. In this case, you would set `errorKey` according to the name of the HTML form field while leaving `name` uniqu (for tracking and debugging purposes)\r\n\r\nReturned result object:\r\n\r\n* `errors` ... an object consisting of all error objects of the rejected promises. Key is the chain link name (property `name`) and value is the rejection value, whatever this is\r\n* `success` ... an array listing all resolved promises\r\n","readmeFilename":"README.md"}