{"name":"defer-promise","author":{"name":"Lloyd Brookes","email":"75pound@gmail.com"},"version":"2.0.0","description":"Isomorphic function returning a deferred promise. Uses native `Promise.defer` if available, else polyfills.","repository":{"type":"git","url":"git+https://github.com/75lb/defer-promise.git"},"license":"MIT","keywords":["defer","promise","es6","native","deferred"],"main":"dist/index.js","engines":{"node":">=6.0.0"},"scripts":{"test":"test-runner test.js","dist":"rollup -c dist/index.config.js"},"devDependencies":{"rollup":"^0.67.4","test-runner":"^0.5.1"},"gitHead":"28090e1c248f334dda759bbec788078ada19bcc6","bugs":{"url":"https://github.com/75lb/defer-promise/issues"},"homepage":"https://github.com/75lb/defer-promise#readme","_id":"defer-promise@2.0.0","_npmVersion":"6.5.0","_nodeVersion":"11.4.0","_npmUser":{"name":"75lb","email":"75pound@gmail.com"},"dist":{"integrity":"sha512-nhZlwPjW+yTbbDcgiwIZJxkMgIVpJOaDgL1x2Ezt6iXGSCqikfQx5fKBVa/GnEnxzFAQxusvSdrgU/TTrvIziQ==","shasum":"72f79dd85c0aa5bafbe224d5f51b33d95b08defb","tarball":"http://registry-npm.ywwl.com/defer-promise/download/defer-promise-2.0.0.tgz","fileCount":4,"unpackedSize":4027,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcEvo7CRA9TVsSAnZWagAAz3YP/jeYOP4GUeUvoxWbXpv7\n0vURX4HiVU5lmLKdQnP5l/SfZyRmwWd4Xo5W9uPIa+OdSgbrYmB/BRR/Pn2o\n5S1CFmoRSiPXQzw296l6P8aAINpCb1raQGG2w/UfPA612NtpnbfdFgwN1TXm\n6K+ILx9ywRLlDTnP+3zY819n7tW71HeL6JUV1yTpEvDQHlBlpSwvyxVXX5GM\nJIrbBJGsCM8T4QuVGV3XHMEo/0uKwZQ/MnHS9xiBKGqQA2GUHyn5EaipskhN\nEPqzGyXaTggWpmCXqIMdscUFI4P/hNrcMCSw0LkIlD8y8v43sWbiOwXHZBd5\nq5GeTjUxEJ7xRq5n1D9Vz29paol75stq2KV5PXARzNY+rkzrqIaiYEk5PpgF\nPXmwtKf4NrKQr9fITxR2BRdEf6KDhtrxMq4GdJkOuKSE5r3y4IB1seDMUnOS\neF+1z1DWA2W4aQqDOkCFBoaXnbNN4jA7/hjBG/ZJqJ69G87dzrAIutuUOE83\n24/s80O/eCS61iKRMg4Ka/znuqTiroZuFUYOkzCnOA2FlYLSqLZBsEA9TN/7\nV/Ma6HBAuK3v0cWvInEfSQml/NVbkNbNR6MI4/edaNnmtTLlUUWvRzJ8jXu8\nGWViHIMt9rFyWBIidcFEWSc4sxebUzXkbVyd7gGzS6FSDS/wmCaA3PbXiN21\nDYuK\r\n=VdxD\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC0ETiUZ+eKiGoJKMLsbrEKzenIASSWBhY8HTKl9htgggIhALFBsLllr+G3h2B6ab0UDFkXKy/q+izDrOeDXX6lsfyk"}],"size":2024,"noattachment":false,"key":"/defer-promise/-/defer-promise-2.0.0.tgz"},"maintainers":[{"name":"75lb","email":"75pound@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/defer-promise_2.0.0_1544747578523_0.3630475068927683"},"_hasShrinkwrap":false,"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":1544747578725,"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":1544747578725,"dist-tags":{"latest":"3.0.1"}}