{"name":"defer-promise","author":{"name":"Lloyd Brookes","email":"75pound@gmail.com"},"version":"0.1.2","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":"edd17dd8c283e9cb5cdc1153d2696cfcc705e448","bugs":{"url":"https://github.com/75lb/defer-promise/issues"},"homepage":"https://github.com/75lb/defer-promise#readme","_id":"defer-promise@0.1.2","_shasum":"12587314679ef3e1b7732a0eafe9a6c2e7a737ae","_from":".","_npmVersion":"3.5.3","_nodeVersion":"5.3.0","_npmUser":{"name":"75lb","email":"75pound@gmail.com"},"dist":{"shasum":"12587314679ef3e1b7732a0eafe9a6c2e7a737ae","tarball":"http://registry-npm.ywwl.com/defer-promise/download/defer-promise-0.1.2.tgz","integrity":"sha512-t+tTuFnsLVg77LXiREYLfQzngePThuGKQjt7vqsQILrrsCTMJZuA45+/9V78ex6W9lGkc9r/DZv/CTKzW2Gaqw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDHMmm8gmKu8uCYxaQZ4ZbTU8zG1OfyO4bmi/dTRR4RKAIhAJ5HoLU624k8I3J6ASKgYKKd2ozRH46KJMUCmtLDns6O"}],"size":1724,"noattachment":false,"key":"/defer-promise/-/defer-promise-0.1.2.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":1450628332074,"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":1450628332074,"dist-tags":{"latest":"3.0.1"}}