{"_id":"p-compose","_rev":"3-54c6455e08168878459e479aa8424d6e","name":"p-compose","dist-tags":{"latest":"1.0.1"},"versions":{"1.0.0":{"name":"p-compose","version":"1.0.0","description":"Like fp.compose, but for Promises.","license":"ISC","main":"index.js","keywords":["compose","promise","compose async","compose promise","functional","function composition","utility"],"author":{"name":"Jason James Pollman","email":"jasonjpollman@gmail.com"},"contributors":[{"name":"Justin D. Fuller","email":"justindanielfuller@gmail.com"}],"repository":{"type":"git","url":"git+https://github.com/JasonPollman/p-compose.git"},"scripts":{"test":"NODE_ENV=test mocha ./test","test:cover":"NODE_ENV=test nyc mocha","compile:node":"NODE_ENV=production npx babel ./src/p-compose.js -o ./dist/p-compose.js","compile:browser":"NODE_ENV=browser npx babel ./src/p-compose.js -o ./dist/p-compose.min.js --source-maps","compile":"rm -rf ./dist && mkdir ./dist && npm run compile:node && npm run compile:browser","prepublish":"npm run compile"},"devDependencies":{"babel-cli":"^6.26.0","babel-core":"^6.26.3","babel-plugin-istanbul":"^4.1.6","babel-plugin-transform-es2015-modules-umd":"^6.24.1","babel-plugin-transform-runtime":"^6.23.0","babel-preset-env":"^1.6.1","babel-preset-minify":"^0.4.1","babel-preset-stage-0":"^6.24.1","babel-register":"^6.26.0","babel-runtime":"^6.26.0","bluebird":"^3.5.1","chai":"^4.1.2","eslint":"^4.19.1","eslint-config-airbnb":"^16.1.0","eslint-plugin-import":"^2.11.0","eslint-plugin-jsx-a11y":"^6.0.3","eslint-plugin-react":"^7.7.0","mocha":"^5.1.1","nyc":"^11.7.2","sinon":"^5.0.7"},"nyc":{"sourceMap":false,"instrument":false,"check-coverage":true,"lines":99,"statements":99,"functions":99,"branches":99,"reporter":["lcov","text-summary"]},"gitHead":"37c8f472d005aa3ce5dbf242ed73b2f76a97930a","bugs":{"url":"https://github.com/JasonPollman/p-compose/issues"},"homepage":"https://github.com/JasonPollman/p-compose#readme","_id":"p-compose@1.0.0","_npmVersion":"5.7.1","_nodeVersion":"8.0.0","_npmUser":{"name":"jasonpollman","email":"jasonjpollman@gmail.com"},"dist":{"integrity":"sha512-M0LFX1pX0WExteeaLCLV83Fd+cCg5Ekztk+P8zWViTx6ugADGHY9izMVmK2Ubrfh9wXpvsnN6jEU1uMSt18T5Q==","shasum":"8d553fdf4e35cc97b337f3d65e27e901cffe39bd","tarball":"https://registry.npmjs.org/p-compose/-/p-compose-1.0.0.tgz","fileCount":11,"unpackedSize":20371,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa8oVpCRA9TVsSAnZWagAAj2QP/10miJhAboVU+l7ZSmNX\nwIhFgTNrcz0mFhmsfV/GJZpsYixAjIyCS9Y5/81AxwZNSVJMrFIRSdq1FvKy\ncAXEZcWJme4610dMF0ctx4ANpoEl/6ArUl7ZcmhxWzzp2vVrOCNZRW/g81A7\nfEP1cY6p58KjH9bTrmGm+ZFxq9udwmoB+vSI6jZ0JD24onAUlnE/oRVRHax4\niymwHaSj5PF+9SnBeyONKdRCRBekOesuKylWHw3eorWLtC4/neBXytXVI80A\nUspnG9Xq6O6PYqMvUkS+fHs/THoxW6/3Egx0UIj+M5BqUmEr6gMq9yMc7Tgr\nMPJBHXiieLmxK8Zq/6KY3Kx7pfAl9PzdYfkw1cvebY47XT0ktkBNrHJCgGhF\n4CPzhHHZiVByK5OyYIyTzeDX+poq9QD2NxTeywhvYKaYgDgyhfoPOiph5QUT\nVPc9mc0FVmZBxmLWsfk+RW/5SzLmbU/ivrFmbIBXaJiP8C8zqVPnxmontnbq\nmk6xrPyv2KFQd9qy6TozCFNxw9gBIgfZuSb6+f3EuISu9D9OZ6FPRT1IhvgW\n+T9AuQjHvks9BhvltBEbfpWsBN6Ld06bKEU+j4y8G0bqj0sR5IaOQkzKzsiI\n1ZeXtV1Ca2v3SCJQ1cec0ynmoVPyMa5M4PopjV2FvseFMd0iQPNuo48nMskN\nLjKU\r\n=e8jq\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC5BGVw4V/qBMzT0FoiFBj/GVfvQhgW0U8IYdK6lbwe/AIhAP7YGoOSWqZreutGMNgaXIBq/LsO/+B8mAOE4C1ZDACN"}]},"maintainers":[{"name":"jasonpollman","email":"jasonjpollman@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/p-compose_1.0.0_1525843304693_0.25330370378483824"},"_hasShrinkwrap":false},"1.0.1":{"name":"p-compose","version":"1.0.1","description":"Like fp.compose, but for Promises.","license":"ISC","main":"index.js","keywords":["compose","promise","compose async","compose promise","functional","function composition","utility"],"author":{"name":"Jason James Pollman","email":"jasonjpollman@gmail.com"},"contributors":[{"name":"Justin D. Fuller","email":"justindanielfuller@gmail.com"}],"repository":{"type":"git","url":"git+https://github.com/JasonPollman/p-compose.git"},"scripts":{"test":"NODE_ENV=test mocha ./test","test:cover":"NODE_ENV=test nyc mocha","compile:node":"NODE_ENV=production npx babel ./src/p-compose.js -o ./dist/p-compose.js","compile:browser":"NODE_ENV=browser npx babel ./src/p-compose.js -o ./dist/p-compose.min.js --source-maps","compile":"rm -rf ./dist && mkdir ./dist && npm run compile:node && npm run compile:browser","prepublish":"npm run compile"},"devDependencies":{"babel-cli":"^6.26.0","babel-core":"^6.26.3","babel-plugin-istanbul":"^4.1.6","babel-plugin-transform-es2015-modules-umd":"^6.24.1","babel-plugin-transform-runtime":"^6.23.0","babel-preset-env":"^1.6.1","babel-preset-minify":"^0.4.1","babel-preset-stage-0":"^6.24.1","babel-register":"^6.26.0","babel-runtime":"^6.26.0","bluebird":"^3.5.1","chai":"^4.1.2","eslint":"^4.19.1","eslint-config-airbnb":"^16.1.0","eslint-plugin-import":"^2.11.0","eslint-plugin-jsx-a11y":"^6.0.3","eslint-plugin-react":"^7.7.0","mocha":"^5.1.1","nyc":"^11.7.2","sinon":"^5.0.7"},"nyc":{"sourceMap":false,"instrument":false,"check-coverage":true,"lines":99,"statements":99,"functions":99,"branches":99,"reporter":["lcov","text-summary"]},"gitHead":"8c731bfa84c59394cfd32a95bc1118984b288a4a","bugs":{"url":"https://github.com/JasonPollman/p-compose/issues"},"homepage":"https://github.com/JasonPollman/p-compose#readme","_id":"p-compose@1.0.1","_npmVersion":"5.7.1","_nodeVersion":"8.0.0","_npmUser":{"name":"jasonpollman","email":"jasonjpollman@gmail.com"},"dist":{"integrity":"sha512-JfraSLNn2a/vPN2C/HfcDap/PfcQ/gxh9ev1+rLjsl10HFTF8tWFzlOyyn+vGRkYHwOh5JEw3VgDkM+AumyUkA==","shasum":"67057324a2ef88f52389e947504a503d108abaa0","tarball":"https://registry.npmjs.org/p-compose/-/p-compose-1.0.1.tgz","fileCount":11,"unpackedSize":20365,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa8olXCRA9TVsSAnZWagAAYUIQAJl0AJmFkbebNX476b2C\n0le4z0kLVVPXWM6y0eC2STAPgysXZamAtEToOJyseq8a9JEW15qs/b9kDvJ1\nIjJ8ItU8tfVw1V4NfIyoVg4JVaBCKNNBbu1h12xcnT19/vPf0bKAu4/+zkl3\nZWYjwALGt3dBe8o6KaKCEzWjjGf899l341YGvf9TPneJV5BukFRIu+aXQBYN\nGkSk765WTD+PMoPp4avEVsjXYmKtx0m8LxhpcaDNAJkIMSuAxIa4FBcWDVIC\nwcqe5Ufj6DT3mWzu+j7Hnzvp3ANFkSUZk3aYrK8Lug2tTQs7lR+fTK1+eLsG\nWohX4sOoFYbuqTRS4UlsYfLMyZ2XxTOkyLJ9sMuVB8bTJxAHaMKRO/itKTvw\nqnN6qhVzNJCyDfz9i18duRVNwwylk07gsFmfR7DKZ1nPb3w6q2zXnhiWwUih\nXQMKgxB5h6yrYVi+l47DRCPf+Hy6VK0/dQL4nuLfEo/xm0J5/FcimrjXhlaT\n4MTZ/Sc2U4yrHqLjM7maSMi/kF4q219k2K2uXO/D7se2JQl2mOccUD4o1juR\nI4Uz2S/UqCOWbvi8Aqo1jyTQLtX+bV7grqB1RTSVIISrIJi2nI3w/W1gd0n5\nowfw7zJxjvqkc3wpVBlz82E5i8Aq9AFEjRI8HETQvGFEq478k2Xag5dZE7+B\n5Bf1\r\n=VHzH\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEvr4LhwJ2IG5MctWJ65bKoSundz2k4LcJYdVxsiJG+jAiB1+ANYpxWt5ng+FleXK24LGG6hrKPziVio+lss5AZUBA=="}]},"maintainers":[{"email":"jasonjpollman@gmail.com","name":"jasonpollman"},{"email":"justindanielfuller@gmail.com","name":"justindfuller"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/p-compose_1.0.1_1525844310570_0.4959634379041129"},"_hasShrinkwrap":false}},"time":{"created":"2018-05-09T05:21:44.692Z","1.0.0":"2018-05-09T05:21:44.764Z","modified":"2022-05-12T10:27:40.113Z","1.0.1":"2018-05-09T05:38:30.685Z"},"maintainers":[{"email":"jasonjpollman@gmail.com","name":"jasonpollman"},{"email":"justindanielfuller@gmail.com","name":"justindfuller"}],"description":"Like fp.compose, but for Promises.","homepage":"https://github.com/JasonPollman/p-compose#readme","keywords":["compose","promise","compose async","compose promise","functional","function composition","utility"],"repository":{"type":"git","url":"git+https://github.com/JasonPollman/p-compose.git"},"contributors":[{"name":"Justin D. Fuller","email":"justindanielfuller@gmail.com"}],"author":{"name":"Jason James Pollman","email":"jasonjpollman@gmail.com"},"bugs":{"url":"https://github.com/JasonPollman/p-compose/issues"},"license":"ISC","readme":"# p-compose\n> Like fp.compose, but for Promises.\n\n**`p-compose` has been designed to function like `fp.compose`.**\n\nThis smally utility library exports a function that composes the given sync/async functions. The rightmost\nfunction can have any arity; the remaining have a fixed arity of 1.\n\n\n## Motivation\nThere's a number of modules out there for Promise function composition, but they have slight differences in\nexpected behavior:\n\n1. Most of them don't support unlimited arity to the rightmost function.\n1. Most of them don't support non-native Promise libraries.\n\n\n## Usage\n```js\nimport compose from 'p-compose';\n\nconst fetchUserById = (id) => {\n  // Make some async db call or something...\n  return Promise.resolve({\n    id,\n    name: {\n      first: 'Chuck',\n      last: 'Norris',\n    },\n  });\n};\n\nconst getUserFullNameById = compose(\n  user => `${user.name.first} ${user.name.last}`,\n  fetchUserById,\n);\n\ngetUserFullNameById(1).then(console.log); // Prints 'Chuck Norris'\n```\n\n\n## Browser Support\n`dist/p-compose.min.js` is UMD and can be imported using require/browsers.\n\n```html\n<script src=\"dist/p-compose.min.js\"></script>\n```\n\nNote: `dist/p-compose.js` is the main export used by node/npm.\n\n\n## Using Non-Native Promises\nYou can use the static method `using` to create a **new** `compose` method\nthat will use the provided Promise library.\n\n```js\nimport pcompose from 'p-compose';\n\n// Creates a *new* function that will use bluebird promises.\nconst compose = pcompose.using(bluebird);\n\nconst doSomething = compose(a, b, ...);\nconst bluebirdPromise = doSomething();\n```\n\n## Alternatives\n- [compose-async](https://www.npmjs.com/package/compose-async)\n- [compose-p](https://www.npmjs.com/package/compose-p)\n- [compose-promise](https://www.npmjs.com/package/compose-promise)\n","readmeFilename":"readme.md"}