{"_id":"prs","_rev":"13-49505f1ea1666b017717021496738a06","name":"prs","time":{"modified":"2022-06-24T22:15:57.110Z","created":"2015-12-06T22:53:59.532Z","1.0.0":"2015-12-06T22:53:59.532Z","1.0.1":"2015-12-06T23:01:33.434Z","1.1.0":"2015-12-07T02:17:30.872Z","3.0.0":"2017-04-15T23:16:37.496Z","3.0.1":"2017-04-16T04:44:55.758Z","3.0.2":"2017-04-16T05:04:46.398Z","3.1.0":"2017-05-10T14:03:09.500Z","3.2.0":"2018-02-26T14:28:19.976Z","3.5.0":"2018-03-15T13:01:32.703Z"},"maintainers":[{"name":"soenkekluth","email":"soenke.kluth@gmail.com"}],"dist-tags":{"latest":"3.5.0"},"description":"alias for `new Promise` plus useful features like compose","readme":"[![Build Status](https://travis-ci.org/soenkekluth/prs.svg?branch=master)](https://travis-ci.org/soenkekluth/prs)\n\n# prs\n\nalias for `new Promise`\n\n## Install\n\n    $ npm install --save prs\n    # or\n    $ yarn add prs\n\n## API\n\n<!-- Generated by documentation.js. Update this documentation by updating the source code. -->\n\n#### Table of Contents\n\n-   [prs](#prs)\n-   [compose](#compose)\n-   [resolve](#resolve)\n-   [reject](#reject)\n-   [all](#all)\n\n### prs\n\nreturns a new Promise\n\n**Parameters**\n\n-   `resolver`  \n-   `null` **[function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function)** (resolve, [reject]) => ..\n\n**Examples**\n\n```javascript\nprs(resolve => {\n\tload(url, resolve);\n}).then(...)\n```\n\n### compose\n\ncreates a Promise of a none-promise function\nyou can also use:\n`promisify() prsfy()` and `prs.fy()` or `prs.ensure()` or `prs.compose()`\n\n**Parameters**\n\n-   `fn` **[function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function)** \n\n**Examples**\n\n```javascript\nconst fn = value => value;\nconst promise = prs.compose(fn);\nconst value = await promise('check');\n```\n\n### resolve\n\nreturns Promise.resolve\nyou can also use:\n`res()` and `prs.res() prs.resolve`\n\n**Parameters**\n\n-   `null` **any** \\*\n\n### reject\n\nreturns Promise.reject\nyou can also use:\n`rej()` and `prs.rej()` `prs.reject()`\n\n**Parameters**\n\n-   `null` **any** \\*\n\n### all\n\nreturns Promise.all\n\n**Parameters**\n\n-   `null` **any** \\*\n\n## Usage\n\n```js\nconst prs = require('prs');\n\nconst resolver = (resolve, reject) => {\n  setTimeout(()=>{\n    resolve('foo');\n  }, 1000);\n};\n\n// Alias for new Promise\nprs(resolver)\n  .then((val) => {\n    console.log(val);\n    // => foo\n  });\n\n// await\nasync function(){\n  const value = await prs(resolver)\n}\n\n// Alias for Promise.resolve\nprs.resolve()\n  .then()...\n\nconst value = await prs.resolve('check');\n\n// or\nprs.res()\n  .then()...\n\n\n// Alias for Promise.all\nprs.all([prs,prs...])\n\n// compose\nconst func = value => value;\nconst promise = prs.compose(func);\nconst value = await promise('check');\nt.is(value, 'check');\n```\n\n## License\n\nMIT © [Sönke Kluth](https://soenkekluth.com)\n","versions":{"3.0.0":{"name":"prs","version":"3.0.0","description":"alias for `new Promise`","main":"index.js","scripts":{"test":"ava"},"repository":{"type":"git","url":"git+https://github.com/soenkekluth/prs.git"},"keywords":[],"author":{"name":"Sönke Kluth","email":"soenke.kluth@gmail.com","url":"http://soenkekluth.com/"},"license":"MIT","bugs":{"url":"https://github.com/soenkekluth/prs/issues"},"homepage":"https://github.com/soenkekluth/prs#readme","devDependencies":{"ava":"0.19.1"},"licenseText":"The MIT License (MIT)\n\nCopyright (c) Sönke Kluth <soenkekluth@gmail.com> (soenkekluth.com)\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n","_id":"prs@3.0.0","dist":{"shasum":"684a22271c082af6068bb17427f3dbcdf739082f","tarball":"https://registry.npmjs.org/prs/-/prs-3.0.0.tgz","integrity":"sha512-4N6Jh3nFHjkvFAlvWnJu6nQm0XQhF0SXN3BOxYsIH0hLggBflcz38N7Ywnv8fGA84KpyrN3DcSyqX4RLFSCgXw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCrtv5T835VxnYZ8ZFx9F68A/w6oxUwar3evM1KxehBjgIhAJlIusL8keDaNeKIAZoIAA1hWk5RacsocyDZ+efzyWgE"}]},"maintainers":[{"name":"soenkekluth","email":"soenke.kluth@gmail.com"}],"_npmUser":{"name":"soenkekluth","email":"soenke.kluth@gmail.com"},"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/prs-3.0.0.tgz_1492298195668_0.2977511384524405"},"directories":{}},"3.0.1":{"name":"prs","version":"3.0.1","description":"alias for `new Promise`","main":"index.js","scripts":{"test":"ava"},"repository":{"type":"git","url":"git+https://github.com/soenkekluth/prs.git"},"keywords":[],"author":{"name":"Sönke Kluth","email":"soenke.kluth@gmail.com","url":"http://soenkekluth.com/"},"license":"MIT","bugs":{"url":"https://github.com/soenkekluth/prs/issues"},"homepage":"https://github.com/soenkekluth/prs#readme","devDependencies":{"ava":"0.19.1"},"licenseText":"The MIT License (MIT)\n\nCopyright (c) Sönke Kluth <soenkekluth@gmail.com> (soenkekluth.com)\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n","_id":"prs@3.0.1","dist":{"shasum":"beeae4fcce61c4c46b82cd4c995b32a71e6de6bc","tarball":"https://registry.npmjs.org/prs/-/prs-3.0.1.tgz","integrity":"sha512-I7smv0R9BbWQ0pIGVtU35G8P5YjhZ00zMPPMrz4gYruAjRbgI0S9D/SLKyUe5covkVcVxCiL6iImPHYASeib1A==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQChPoZ9RMo7nWn20DzScxukweH0FO8zbn6YBST28ZmJwQIhAM8UP7Z+m+nEG8tbRh4gz3phUCpHK0yqOw0fFcJv+cNe"}]},"maintainers":[{"name":"soenkekluth","email":"soenke.kluth@gmail.com"}],"_npmUser":{"name":"soenkekluth","email":"soenke.kluth@gmail.com"},"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/prs-3.0.1.tgz_1492317893726_0.34483473282307386"},"directories":{}},"3.0.2":{"name":"prs","version":"3.0.2","description":"alias for `new Promise`","main":"index.js","scripts":{"test":"ava -v"},"repository":{"type":"git","url":"git+https://github.com/soenkekluth/prs.git"},"keywords":[],"author":{"name":"Sönke Kluth","email":"soenke.kluth@gmail.com","url":"http://soenkekluth.com/"},"license":"MIT","bugs":{"url":"https://github.com/soenkekluth/prs/issues"},"homepage":"https://github.com/soenkekluth/prs#readme","devDependencies":{"ava":"0.19.1"},"licenseText":"The MIT License (MIT)\n\nCopyright (c) Sönke Kluth <soenkekluth@gmail.com> (soenkekluth.com)\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n","_id":"prs@3.0.2","dist":{"shasum":"87df90e03a5b12fa58d293d82a2cd47a1c944076","tarball":"https://registry.npmjs.org/prs/-/prs-3.0.2.tgz","integrity":"sha512-HpBlMB7pA1j7NqcbGwGTKRx7OnlnZAVDgQH6QoPhkFaqf1V8yr0OAb5sFzuBGxI4aEoKj7tgJkhoCLIMWbLsrA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHz0UXQPZNBJe5hgRe5+gctkbfVi/48C3QWTfvTn3NxmAiEAqSAya3gnLkZsvyep94Eei8jF8x3MFAIpOiulM4SINL4="}]},"maintainers":[{"name":"soenkekluth","email":"soenke.kluth@gmail.com"}],"_npmUser":{"name":"soenkekluth","email":"soenke.kluth@gmail.com"},"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/prs-3.0.2.tgz_1492319085723_0.5672119401860982"},"directories":{}},"3.1.0":{"name":"prs","version":"3.1.0","description":"alias for `new Promise`","main":"index.js","scripts":{"test":"ava -v"},"repository":{"type":"git","url":"git+https://github.com/soenkekluth/prs.git"},"keywords":[],"author":{"name":"Sönke Kluth","email":"soenke.kluth@gmail.com","url":"http://soenkekluth.com/"},"license":"MIT","bugs":{"url":"https://github.com/soenkekluth/prs/issues"},"homepage":"https://github.com/soenkekluth/prs#readme","devDependencies":{"ava":"0.19.1","performance-now":"2.1.0","tap-diff":"0.1.1"},"gitHead":"7de05b406c3a01b7a110bc82b388025a8b17b14d","_id":"prs@3.1.0","_shasum":"09448dc9cc4407b29ed22000b3b59549ddf5c957","_from":".","_npmVersion":"4.5.0","_nodeVersion":"7.10.0","_npmUser":{"name":"soenkekluth","email":"soenke.kluth@gmail.com"},"dist":{"shasum":"09448dc9cc4407b29ed22000b3b59549ddf5c957","tarball":"https://registry.npmjs.org/prs/-/prs-3.1.0.tgz","integrity":"sha512-V3CqYCBvdiiemimZxDe1iOkadqN5164CSmaWy2+2a0Xmgyssd6/ciTKNGWmXIyNEY4l/teF5xIyleKQw4dkGxQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICCvGfzoRx0QtAsAvck7up6BiOeNQcrZDGsfV0AS9ufoAiEA/52jXYNQIZbrbc2X5ZReanIsQB5cVnVU8r3vMqNP2KM="}]},"maintainers":[{"name":"soenkekluth","email":"soenke.kluth@gmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/prs-3.1.0.tgz_1494424987356_0.8370826547034085"},"directories":{}},"3.2.0":{"name":"prs","version":"3.2.0","description":"alias for `new Promise` plus useful features like compose","umd:main":"dist/prs.umd.js","module":"dist/prs.es.js","main":"dist/prs.js","scripts":{"test":"ava -v","prepublish":"ava -v","lint":"eslint index.js","lint:fix":"yarn lint --fix","build":"microbundle build index.js","docs":"documentation readme index.js --section API -q"},"repository":{"type":"git","url":"git+https://github.com/soenkekluth/prs.git"},"keywords":["Promise","short-hand","promisify","async","await","compose","polyfill"],"author":{"name":"Sönke Kluth","email":"soenke.kluth@gmail.com","url":"http://soenkekluth.com/"},"license":"MIT","bugs":{"url":"https://github.com/soenkekluth/prs/issues"},"homepage":"https://github.com/soenkekluth/prs#readme","devDependencies":{"ava":"0.25.0","babel-eslint":"8.2.2","documentation":"^5.4.0","eslint":"4.18.1","eslint-config-prettier":"2.9.0","eslint-config-sk":"0.1.8","eslint-plugin-prettier":"2.6.0","microbundle":"^0.4.4","performance-now":"2.1.0","prettier":"1.10.2","tap-diff":"0.1.1"},"dependencies":{"lodash.flowright":"^3.5.0"},"gitHead":"205aa0e978503228e25d56591430e4d9f2a5d6db","_id":"prs@3.2.0","_npmVersion":"5.6.0","_nodeVersion":"9.4.0","_npmUser":{"name":"soenkekluth","email":"soenke.kluth@gmail.com"},"dist":{"integrity":"sha512-ycNXVfAyRBjr4CliXibQvys6lt5hihssmYGFrPCxIM+AAs4Rr/LaQq7hBppEuMRTdY2LBCkCy441+YlGvDKkHQ==","shasum":"28bc4212a47fc41c3078ae8b753c548c835bf681","tarball":"https://registry.npmjs.org/prs/-/prs-3.2.0.tgz","fileCount":14,"unpackedSize":324359,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDvUJOVOpfDvCgWGumCLF+s57+UjJOB45o3wFKQTxZ2xgIgA/9w0U+mdlQR5p0dfC3MOJ/vZi6P8U+frJM4ptEXieM="}]},"maintainers":[{"name":"soenkekluth","email":"soenke.kluth@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/prs_3.2.0_1519655299850_0.6549978368455602"},"_hasShrinkwrap":false},"3.5.0":{"name":"prs","version":"3.5.0","description":"alias for `new Promise` plus useful features like compose","umd:main":"lib/prs.umd.js","module":"lib/prs.es.js","main":"lib/prs.js","scripts":{"test":"ava -v","-prepublish":"ava -v","lint":"eslint './src/**/*.js' --parser-options=ecmaVersion:7 --format=html -o 'lint-result.html' --cache --cache-location '/tmp/.eslintcache/'","gh-pages":"gh-pages -d ./docs","size":"echo \"Gzipped Size: $(strip-json-comments lib/prs.js | gzip-size)\"","lint:fix":"yarn lint --fix","cleanup":"rm -rf lib","build:umd":"microbundle build src/index.js -f umd","build:lib":"rollup -c ./config/rollup.config.js","uglify":"uglifyjs lib/prs.umd.js --config-file ./config/uglify.json -o lib/prs.min.js","build":"run-s cleanup build:lib build:umd uglify size docs","watch":"rollup -cwm","docs":"documentation readme ./src/index.js --section API -q"},"engines":{"node":">=9.0.0"},"repository":{"type":"git","url":"git+https://github.com/soenkekluth/prs.git"},"files":["lib"],"keywords":["Promise","short-hand","promisify","async","await","compose","polyfill"],"author":{"name":"Sönke Kluth","email":"soenke.kluth@gmail.com","url":"http://soenkekluth.com/"},"license":"MIT","bugs":{"url":"https://github.com/soenkekluth/prs/issues"},"homepage":"https://github.com/soenkekluth/prs#readme","devDependencies":{"ava":"0.25.0","babel-eslint":"8.2.2","bundlesize":"^0.16.0","documentation":"^6.1.0","eslint":"4.18.2","eslint-config-sk-browser":"^0.5.7","gzip-size-cli":"^2.1.0","microbundle":"^0.4.4","npm-run-all":"^4.1.2","performance-now":"2.1.0","prettier":"1.11.1","rimraf":"^2.6.2","rollup":"^0.57.0","rollup-plugin-buble":"^0.19.2","rollup-plugin-commonjs":"^9.1.0","rollup-plugin-node-resolve":"^3.2.0","rollup-plugin-replace":"^2.0.0","tap-diff":"0.1.1","uglify-js":"^3.3.15"},"dependencies":{"lodash.flowright":"^3.5.0","promise-polyfill":"^7.1.0"},"gitHead":"b6f329c5d9e8570effb9f768e874a63046238bc9","_id":"prs@3.5.0","_npmVersion":"5.7.1","_nodeVersion":"9.8.0","_npmUser":{"name":"soenkekluth","email":"soenke.kluth@gmail.com"},"dist":{"integrity":"sha512-SyRise8VYsT6B1dAomQaDOBP1tZ9fTQ5SAhUffFZRG8988Nmc03NQrZMkVSyAlrty10qJ3HvFggjMR+aa7Zn7w==","shasum":"51b5e245f8b74f491dbd42d9f8ebc1a7b1d27c8f","tarball":"https://registry.npmjs.org/prs/-/prs-3.5.0.tgz","fileCount":10,"unpackedSize":36926,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAQnQ4dL3V+Z6T9RTm9fph8DQ5ZE1e6FRVqUv4KujirJAiB7q6wa0/+1C/Zyi1Dhjm0VaWZo5iYh1xk54nUlbMHdyQ=="}]},"maintainers":[{"name":"soenkekluth","email":"soenke.kluth@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/prs_3.5.0_1521118892621_0.6177714592318053"},"_hasShrinkwrap":false}},"homepage":"https://github.com/soenkekluth/prs#readme","keywords":["Promise","short-hand","promisify","async","await","compose","polyfill"],"repository":{"type":"git","url":"git+https://github.com/soenkekluth/prs.git"},"author":{"name":"Sönke Kluth","email":"soenke.kluth@gmail.com","url":"http://soenkekluth.com/"},"bugs":{"url":"https://github.com/soenkekluth/prs/issues"},"license":"MIT","readmeFilename":"README.md"}