{"name":"defer-promise","author":{"name":"Lloyd Brookes","email":"75pound@gmail.com"},"version":"0.1.1","description":"defer-promise","repository":{"type":"git","url":"git+https://github.com/75lb/defer-promise.git"},"license":"MIT","main":"./lib/defer-promise.js","keywords":["defer","promise","es6","native","deferred"],"engines":{"node":">=0.10.0"},"scripts":{"test":"tape test/*.js","docs":"jsdoc2md -t jsdoc2md/README.hbs lib/*.js > README.md; echo"},"gitHead":"e428036cbd3513b44f3c46447e278f9633e0e2e9","bugs":{"url":"https://github.com/75lb/defer-promise/issues"},"homepage":"https://github.com/75lb/defer-promise#readme","_id":"defer-promise@0.1.1","_shasum":"7b7636b6108decb3ac03dd3f532c228b775bd368","_from":".","_npmVersion":"3.3.10","_nodeVersion":"4.2.1","_npmUser":{"name":"75lb","email":"75pound@gmail.com"},"dist":{"shasum":"7b7636b6108decb3ac03dd3f532c228b775bd368","tarball":"http://registry-npm.ywwl.com/defer-promise/download/defer-promise-0.1.1.tgz","integrity":"sha512-fBx3O4wlCBDBcsvR1Nqv1qSMMu0OiXUEJ2iFDh2Zs/F0hmqv1rOusP3rLAR7XR3kZ/anRSwGFxCS89t52dsKqg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIACS6ypyHPVlHsK7SGdTP/jt5lnxcS7sVQQOddn8Yr6/AiByhqrsK1cBi8uD7/86iFVE9mG464leXl2EIlV8VMijMw=="}],"size":1680,"noattachment":false,"key":"/defer-promise/-/defer-promise-0.1.1.tgz"},"maintainers":[{"name":"75lb","email":"75pound@gmail.com"}],"directories":{},"readme":"[![view on npm](https://badgen.net/npm/v/defer-promise)](https://www.npmjs.org/package/defer-promise)\n[![npm module downloads](https://badgen.net/npm/dt/defer-promise)](https://www.npmjs.org/package/defer-promise)\n[![Gihub repo dependents](https://badgen.net/github/dependents-repo/75lb/defer-promise)](https://github.com/75lb/defer-promise/network/dependents?dependent_type=REPOSITORY)\n[![Gihub package dependents](https://badgen.net/github/dependents-pkg/75lb/defer-promise)](https://github.com/75lb/defer-promise/network/dependents?dependent_type=PACKAGE)\n[![Node.js CI](https://github.com/75lb/defer-promise/actions/workflows/node.js.yml/badge.svg)](https://github.com/75lb/defer-promise/actions/workflows/node.js.yml)\n[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg)](https://github.com/feross/standard)\n\n# defer-promise\n\nIsomorphic function returning a deferred promise with `resolve` and `reject` methods. If the global `Promise.defer()` method exists it will use that, else polyfill.\n\n```js\nimport defer from 'defer-promise'\nconst deferred = defer()\n\n/* Async function using a callback instead of returning a promise */\ndoSomething((result, err) => {\n  if (err) {\n    deferred.reject(err)\n  } else {\n    deferred.resolve(result)\n  }\n})\n\nconst result = await deferred.promise;\n```\n\n## Load anywhere\n\nThis library can be loaded anywhere, natively without transpilation.\n\nCommon JS:\n\n```js\nconst defer = require('defer-promise')\n```\n\nNode.js with ECMAScript Module support enabled:\n\n```js\nimport defer from 'defer-promise'\n```\n\nModern browser ECMAScript Module:\n\n```js\nimport defer from './node_modules/defer-promise/index.js'\n```\n\n* * *\n\n&copy; 2015-22 Lloyd Brookes \\<75pound@gmail.com\\>. Documented by [jsdoc-to-markdown](https://github.com/jsdoc2md/jsdoc-to-markdown).\n","publish_time":1445793595577,"deprecated":"Deferred promises have been standardised by the native Promise.withResolvers() method. This library will continue to function correctly but will no longer be maintained.","_cnpm_publish_time":1445793595577,"dist-tags":{"latest":"3.0.1"}}