{"name":"pinkie","version":"2.0.4","description":"Itty bitty little widdle twinkie pinkie ES2015 Promise implementation","license":"MIT","repository":"floatdrop/pinkie","author":{"name":"Vsevolod Strukchinsky","email":"floatdrop@gmail.com","url":"github.com/floatdrop"},"engines":{"node":">=0.10.0"},"scripts":{"test":"xo && nyc mocha","coverage":"nyc report --reporter=text-lcov | coveralls"},"files":["index.js"],"keywords":["promise","promises","es2015","es6"],"devDependencies":{"core-assert":"^0.1.1","coveralls":"^2.11.4","mocha":"*","nyc":"^3.2.2","promises-aplus-tests":"*","xo":"^0.10.1"},"_id":"pinkie@2.0.4","_npmVersion":"0.0.0-fake","_nodeVersion":"0.0.0-fake","_shasum":"72556b80cfa0d48a974e80e77248e80ed4f7f870","_npmUser":{"name":"npm","email":"support@npmjs.com"},"_from":".","dist":{"shasum":"72556b80cfa0d48a974e80e77248e80ed4f7f870","tarball":"http://registry-npm.ywwl.com/pinkie/download/pinkie-2.0.4.tgz","integrity":"sha512-MnUuEycAemtSaeFSjXKW/aroV7akBbY+Sv+RkyqFjgAe73F+MR0TBWKBRDkmfWq/HiFmdavfZ1G7h4SPZXaCSg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC4Fqw4SBUnt8DQH0DT4kodbHO0d7r99wyjuPhZQGOx2gIgBNh1Nv/qeJtxv/2oiTsD47rHcF1QXQ7rwqKKZAIpBeA="}],"size":3935,"noattachment":false,"key":"/pinkie/-/pinkie-2.0.4.tgz"},"maintainers":[{"name":"puradox","email":"sambalana247@gmail.com"}],"directories":{},"readme":"<h1 align=\"center\">\r\n\t<br>\r\n\t<img width=\"256\" src=\"media/logo.png\" alt=\"pinkie\">\r\n\t<br>\r\n\t<br>\r\n</h1>\r\n\r\n> Itty bitty little widdle twinkie pinkie [ES2015 Promise](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-promise-objects) implementation\r\n\r\n[![Build Status](https://travis-ci.org/floatdrop/pinkie.svg?branch=master)](https://travis-ci.org/floatdrop/pinkie)  [![Coverage Status](https://coveralls.io/repos/floatdrop/pinkie/badge.svg?branch=master&service=github)](https://coveralls.io/github/floatdrop/pinkie?branch=master)\r\n\r\nThere are [tons of Promise implementations](https://github.com/promises-aplus/promises-spec/blob/master/implementations.md#standalone) out there, but all of them focus on browser compatibility and are often bloated with functionality.\r\n\r\nThis module is an exact Promise specification polyfill (like [native-promise-only](https://github.com/getify/native-promise-only)), but in Node.js land (it should be browserify-able though).\r\n\r\n\r\n## Install\r\n\r\n```\r\n$ npm install --save pinkie\r\n```\r\n\r\n\r\n## Usage\r\n\r\n```js\r\nvar fs = require('fs');\r\nvar Promise = require('pinkie');\r\n\r\nnew Promise(function (resolve, reject) {\r\n\tfs.readFile('foo.json', 'utf8', function (err, data) {\r\n\t\tif (err) {\r\n\t\t\treject(err);\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tresolve(data);\r\n\t});\r\n});\r\n//=> Promise\r\n```\r\n\r\n\r\n### API\r\n\r\n`pinkie` exports bare [ES2015 Promise](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-promise-objects) implementation and polyfills [Node.js rejection events](https://nodejs.org/api/process.html#process_event_unhandledrejection). In case you forgot:\r\n\r\n#### new Promise(executor)\r\n\r\nReturns new instance of `Promise`.\r\n\r\n##### executor\r\n\r\n*Required*  \r\nType: `function`\r\n\r\nFunction with two arguments `resolve` and `reject`. The first argument fulfills the promise, the second argument rejects it.\r\n\r\n#### pinkie.all(promises)\r\n\r\nReturns a promise that resolves when all of the promises in the `promises` Array argument have resolved.\r\n\r\n#### pinkie.race(promises)\r\n\r\nReturns a promise that resolves or rejects as soon as one of the promises in the `promises` Array resolves or rejects, with the value or reason from that promise.\r\n\r\n#### pinkie.reject(reason)\r\n\r\nReturns a Promise object that is rejected with the given `reason`.\r\n\r\n#### pinkie.resolve(value)\r\n\r\nReturns a Promise object that is resolved with the given `value`. If the `value` is a thenable (i.e. has a then method), the returned promise will \"follow\" that thenable, adopting its eventual state; otherwise the returned promise will be fulfilled with the `value`.\r\n\r\n\r\n## Related\r\n\r\n- [pinkie-promise](https://github.com/floatdrop/pinkie-promise) - Returns the native Promise or this module\r\n\r\n\r\n## License\r\n\r\nMIT © [Vsevolod Strukchinsky](http://github.com/floatdrop)\r\n","publish_time":1454324926357,"_cnpm_publish_time":1454324926357,"dist-tags":{"latest":"2.0.4"}}