{"id":17766655,"url":"https://github.com/floatdrop/pinkie","last_synced_at":"2025-03-15T13:30:53.069Z","repository":{"id":31814242,"uuid":"35380896","full_name":"floatdrop/pinkie","owner":"floatdrop","description":"Itty bitty little widdle twinkie pinkie ES2015 Promise implementation","archived":false,"fork":false,"pushed_at":"2018-08-20T20:16:29.000Z","size":710,"stargazers_count":139,"open_issues_count":2,"forks_count":18,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-03-09T18:35:13.386Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/floatdrop.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"license","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-05-10T17:32:51.000Z","updated_at":"2025-01-20T14:16:37.000Z","dependencies_parsed_at":"2022-08-31T06:01:42.088Z","dependency_job_id":null,"html_url":"https://github.com/floatdrop/pinkie","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/floatdrop%2Fpinkie","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/floatdrop%2Fpinkie/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/floatdrop%2Fpinkie/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/floatdrop%2Fpinkie/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/floatdrop","download_url":"https://codeload.github.com/floatdrop/pinkie/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243735797,"owners_count":20339530,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-26T20:33:59.521Z","updated_at":"2025-03-15T13:30:53.063Z","avatar_url":"https://github.com/floatdrop.png","language":"JavaScript","funding_links":[],"categories":["Promises/A+ Implementations (ES6/ES2015 compatible)"],"sub_categories":["Strict Implementations"],"readme":"\u003ch1 align=\"center\"\u003e\n\t\u003cbr\u003e\n\t\u003cimg width=\"256\" src=\"media/logo.png\" alt=\"pinkie\"\u003e\n\t\u003cbr\u003e\n\t\u003cbr\u003e\n\u003c/h1\u003e\n\n\u003e Itty bitty little widdle twinkie pinkie [ES2015 Promise](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-promise-objects) implementation\n\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\u0026service=github)](https://coveralls.io/github/floatdrop/pinkie?branch=master)\n\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.\n\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).\n\n\n## Install\n\n```\n$ npm install --save pinkie\n```\n\n\n## Usage\n\n```js\nvar fs = require('fs');\nvar Promise = require('pinkie');\n\nnew Promise(function (resolve, reject) {\n\tfs.readFile('foo.json', 'utf8', function (err, data) {\n\t\tif (err) {\n\t\t\treject(err);\n\t\t\treturn;\n\t\t}\n\n\t\tresolve(data);\n\t});\n});\n//=\u003e Promise\n```\n\n\n### API\n\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:\n\n#### new Promise(executor)\n\nReturns new instance of `Promise`.\n\n##### executor\n\n*Required*  \nType: `function`\n\nFunction with two arguments `resolve` and `reject`. The first argument fulfills the promise, the second argument rejects it.\n\n#### pinkie.all(promises)\n\nReturns a promise that resolves when all of the promises in the `promises` Array argument have resolved.\n\n#### pinkie.race(promises)\n\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.\n\n#### pinkie.reject(reason)\n\nReturns a Promise object that is rejected with the given `reason`.\n\n#### pinkie.resolve(value)\n\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`.\n\n\n## Related\n\n- [pinkie-promise](https://github.com/floatdrop/pinkie-promise) - Returns the native Promise or this module\n\n\n## License\n\nMIT © [Vsevolod Strukchinsky](http://github.com/floatdrop)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffloatdrop%2Fpinkie","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffloatdrop%2Fpinkie","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffloatdrop%2Fpinkie/lists"}