{"_id":"es6-promise-try","_rev":"7-46e164803fca48935bf3e458a372fd5f","name":"es6-promise-try","description":"Promise.try shim for ES6 Promises","dist-tags":{"latest":"1.0.2"},"versions":{"0.0.1":{"name":"es6-promise-try","version":"0.0.1","description":"Promise.try shim for ES6 Promises","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"http://git.cryto.net/joepie91/node-es6-promise-try.git"},"keywords":["es6","promises","shim"],"author":{"name":"Sven Slootweg"},"license":"WTFPL","dependencies":{},"devDependencies":{"@joepie91/gulp-preset-es2015":"^1.0.1","babel-preset-es2015":"^6.6.0","gulp":"^3.9.1"},"gitHead":"a812c8ae942163670b68d9f6f0e0dcb719524227","_id":"es6-promise-try@0.0.1","_shasum":"10f140dad27459cef949973e5d21a087f7274b20","_from":".","_npmVersion":"3.5.0","_nodeVersion":"4.2.1","_npmUser":{"name":"joepie91","email":"admin@cryto.net"},"dist":{"shasum":"10f140dad27459cef949973e5d21a087f7274b20","tarball":"https://registry.npmjs.org/es6-promise-try/-/es6-promise-try-0.0.1.tgz","integrity":"sha512-T6f3cNyF8y+3uua2IDGpGmeoDe2w7PXGfPGS94TyLfQLPzYVvZUfM8dQuN4DuVXpelK4tg9F7zKzZHzNS2f2IQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHPhZARbD2vQrx0PDtg+NZciLikvcJ4we+0nAsgHmoeCAiB5caAGHLYsTjAKt/Tif77qJga9CJ8o3z1I63pv3bzy9A=="}]},"maintainers":[{"name":"joepie91","email":"admin@cryto.net"}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/es6-promise-try-0.0.1.tgz_1460908661977_0.02705104975029826"},"directories":{}},"1.0.0":{"name":"es6-promise-try","version":"1.0.0","description":"Promise.try shim for ES6 Promises","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"http://git.cryto.net/joepie91/node-es6-promise-try.git"},"keywords":["es6","promises","shim"],"author":{"name":"Sven Slootweg"},"license":"WTFPL","dependencies":{},"devDependencies":{"@joepie91/gulp-preset-es2015":"^1.0.1","babel-preset-es2015":"^6.6.0","gulp":"^3.9.1"},"gitHead":"b1b71256385964f38aad0d1f7170e434116cf7f0","_id":"es6-promise-try@1.0.0","_shasum":"65e8cde8d01340bcd3abd25471a67f7ed039f21a","_from":".","_npmVersion":"3.10.5","_nodeVersion":"5.1.0","_npmUser":{"name":"joepie91","email":"admin@cryto.net"},"dist":{"shasum":"65e8cde8d01340bcd3abd25471a67f7ed039f21a","tarball":"https://registry.npmjs.org/es6-promise-try/-/es6-promise-try-1.0.0.tgz","integrity":"sha512-oVoIZmTyS3mxdCw1Zu7g5yAm2EVsDiC6M+VatwTNA6sHxQ1Km54e/DOQNUMQOXCLWuL4xTFkyl22N/o8+mxYew==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCGtQR59kMaXkkLNe9jEeIcW4KahnvPKTk2T8BRlZO/VgIhAKsdZ/6uZCAz4p3jf6aCBssMXt4LxJOdbmfriTYSD0/n"}]},"maintainers":[{"name":"joepie91","email":"admin@cryto.net"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/es6-promise-try-1.0.0.tgz_1471383030943_0.3343182534445077"},"directories":{}},"1.0.1":{"name":"es6-promise-try","version":"1.0.1","description":"Promise.try shim for ES6 Promises","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"http://git.cryto.net/joepie91/node-es6-promise-try.git"},"keywords":["es6","promises","shim"],"author":{"name":"Sven Slootweg"},"license":"WTFPL","dependencies":{},"devDependencies":{"@joepie91/gulp-preset-es2015":"^1.0.1","babel-preset-es2015":"^6.6.0","gulp":"^3.9.1"},"gitHead":"cf02f6ac5f0703b672dd5d6b5d89b406aa5a6e9d","_id":"es6-promise-try@1.0.1","_shasum":"4085ce43683518d25aa003e7e1b11d50e4fa0545","_from":".","_npmVersion":"3.10.5","_nodeVersion":"5.1.0","_npmUser":{"name":"joepie91","email":"admin@cryto.net"},"dist":{"shasum":"4085ce43683518d25aa003e7e1b11d50e4fa0545","tarball":"https://registry.npmjs.org/es6-promise-try/-/es6-promise-try-1.0.1.tgz","integrity":"sha512-chiPUa+9YmcNgLUF4VymDgceFHtJYYA96mcGzYN5VaDtmST4vZaOkNLClnQ5qbWxv5KPrpQw+9KFaJP0+2vRAw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIH2ax0N5PMjDSiKN5WU1EAbcpW8TNytWmbRn1guBuVDhAiBW4BWtqRl91QQaM9EU0sb0xiPDLYx9Av0ce8Vj5ZgW1A=="}]},"maintainers":[{"name":"joepie91","email":"admin@cryto.net"}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/es6-promise-try-1.0.1.tgz_1471383649152_0.922831769566983"},"directories":{}},"1.0.2":{"name":"es6-promise-try","version":"1.0.2","description":"Promise.try shim for ES6 Promises","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"http://git.cryto.net/joepie91/node-es6-promise-try.git"},"keywords":["es6","promises","shim"],"author":{"name":"Sven Slootweg"},"license":"WTFPL","dependencies":{},"devDependencies":{"@joepie91/gulp-preset-es2015":"^1.0.1","babel-preset-es2015":"^6.6.0","gulp":"^3.9.1"},"gitHead":"a7807b4bde8da93b37fe55bfec2e6f47dd5d6f9f","_id":"es6-promise-try@1.0.2","_shasum":"91f718b8140c3e5d6b187715a2d8707db96c4803","_from":".","_npmVersion":"3.10.5","_nodeVersion":"5.1.0","_npmUser":{"name":"joepie91","email":"admin@cryto.net"},"dist":{"shasum":"91f718b8140c3e5d6b187715a2d8707db96c4803","tarball":"https://registry.npmjs.org/es6-promise-try/-/es6-promise-try-1.0.2.tgz","integrity":"sha512-t7xE0FUYBa84ma0rpcvPGV7PaNS8ljeMYdG49zRFBkkJYi6ZhVH2PHo4/PIdZc9H4G1lrx0vMqoZzsPAd7arPw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHm6KFAKQr/nEjZgm5ZUcKveIHjb/HFA18haDmDI2HcnAiEAusRTthD0TqGalsNbzRphY8XddanYZfdL52xP+05ATn0="}]},"maintainers":[{"name":"joepie91","email":"admin@cryto.net"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/es6-promise-try-1.0.2.tgz_1471383785835_0.8415564417373389"},"directories":{}}},"readme":"# es6-promise-try\n\nA `Promise.try` shim for ES6 Promises.\n\n`Promise.try` is an important tool for writing robust and readable code with Promises ([this article](http://cryto.net/~joepie91/blog/2016/05/11/what-is-promise-try-and-why-does-it-matter/) explains why), but ES6 Promises do not ([yet](https://github.com/ljharb/proposal-promise-try)) include this in their specification. This module provides an implementation of `Promise.try` for ES6 Promises that can be used stand-alone, without modifying `Promise`'s prototype.\n\nThe goal of this module is to be *functionally equivalent* to Bluebird's `Promise.try` implementation. If you find that it behaves differently in some way, please file a bug.\n\n__This module requires ES6 Promises to be available in your environment.__ If you are targeting a platform that doesn't (always) provide ES6 Promises natively, you will need to use a polyfill like [`es6-promise`](https://www.npmjs.com/package/es6-promise).\n\n## License\n\n[WTFPL](http://www.wtfpl.net/txt/copying/) or [CC0](https://creativecommons.org/publicdomain/zero/1.0/), whichever you prefer. A donation and/or attribution are appreciated, but not required.\n\n## Donate\n\nMaintaining open-source projects takes a lot of time, and the more donations I receive, the more time I can dedicate to open-source. If this module is useful to you, consider [making a donation](http://cryto.net/~joepie91/donate.html)!\n\nYou can donate using Bitcoin, PayPal, Flattr, cash-in-mail, SEPA transfers, and pretty much anything else. Thank you!\n\n## Contributing\n\nPull requests welcome. Please make sure your modifications are in line with the overall code style, and ensure that you're editing the files in `src/`, not those in `lib/`.\n\nBuild tool of choice is `gulp`; simply run `gulp` while developing, and it will watch for changes.\n\nBe aware that by making a pull request, you agree to release your modifications under the licenses stated above.\n\n## Usage\n\nAn example from [the article](http://cryto.net/~joepie91/blog/2016/05/11/what-is-promise-try-and-why-does-it-matter/):\n\n```javascript\nvar promiseTry = require(\"es6-promise-try\");\n\nfunction getUsername(userId) {\n    return promiseTry(function() {\n        return database.users.get({id: userID});\n    }).then(function(user) {\n        return user.name;\n    });\n}\n```\n\n## API\n\n### promiseTry(func)\n\nImmediately invokes `func` - in the same tick of the event loop - and wraps it to provide error-handling and Promises/A+ compatibility, as described in [the article](http://cryto.net/~joepie91/blog/2016/05/11/what-is-promise-try-and-why-does-it-matter/). Functionally equivalent to [Bluebird's `Promise.try`](http://bluebirdjs.com/docs/api/promise.try.html).","maintainers":[{"name":"joepie91","email":"admin@cryto.net"}],"time":{"modified":"2022-06-17T17:01:38.415Z","created":"2016-04-17T15:57:43.014Z","0.0.1":"2016-04-17T15:57:43.014Z","1.0.0":"2016-08-16T21:30:32.723Z","1.0.1":"2016-08-16T21:40:51.937Z","1.0.2":"2016-08-16T21:43:07.683Z"},"keywords":["es6","promises","shim"],"repository":{"type":"git","url":"http://git.cryto.net/joepie91/node-es6-promise-try.git"},"author":{"name":"Sven Slootweg"},"license":"WTFPL","readmeFilename":"README.md","users":{"nmccready":true}}