{"name":"defer-promise","author":{"name":"Lloyd Brookes","email":"75pound@gmail.com"},"version":"1.0.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":"test-runner test/*.js","docs":"jsdoc2md -t jsdoc2md/README.hbs lib/*.js > README.md; echo"},"devDependencies":{"test-runner":"^0.3.0"},"gitHead":"64aa2664317790e567dfdb91ae04bf52db440083","bugs":{"url":"https://github.com/75lb/defer-promise/issues"},"homepage":"https://github.com/75lb/defer-promise#readme","_id":"defer-promise@1.0.1","_shasum":"1ca6ffeddbcef1715dd7aae25c7616f9ae22932f","_from":".","_npmVersion":"4.1.2","_nodeVersion":"7.5.0","_npmUser":{"name":"75lb","email":"75pound@gmail.com"},"dist":{"shasum":"1ca6ffeddbcef1715dd7aae25c7616f9ae22932f","tarball":"http://registry-npm.ywwl.com/defer-promise/download/defer-promise-1.0.1.tgz","integrity":"sha512-oNXP2pRffPlQSWxDLadholXlEzP5JyJBG6i5kt5OMSc/3u6Xwe95lqXTENzJ/IKOYEZ+aaHIvtDWI7hpoov0Ew==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEFlP+xWMvz74J5kyyI5QoG3si+QPoJ5oo+LF+vWhprYAiEAuNUT24/DVAHYMvUE5XDWLwDhrj8NuIf2RXrPufarscE="}],"size":2020,"noattachment":false,"key":"/defer-promise/-/defer-promise-1.0.1.tgz"},"maintainers":[{"name":"75lb","email":"75pound@gmail.com"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/defer-promise-1.0.1.tgz_1486070334680_0.20472807600162923"},"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":1486070335304,"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":1486070335304,"dist-tags":{"latest":"3.0.1"}}