{"_id":"@braintree/wrap-promise","_rev":"10-2009165b6727435a17181b4a244a771f","name":"@braintree/wrap-promise","dist-tags":{"latest":"3.0.4"},"versions":{"1.1.1":{"name":"@braintree/wrap-promise","version":"1.1.1","keywords":[],"author":{"name":"Braintree","email":"code@getbraintree.com"},"license":"MIT","_id":"@braintree/wrap-promise@1.1.1","maintainers":[{"name":"braintree","email":"devs@getbraintree.com"}],"homepage":"https://github.com/braintree/wrap-promise#readme","bugs":{"url":"https://github.com/braintree/wrap-promise/issues"},"dist":{"shasum":"d22c76855e6d4b4012610060421fae1a37ec90b0","tarball":"https://registry.npmjs.org/@braintree/wrap-promise/-/wrap-promise-1.1.1.tgz","integrity":"sha512-iIYldcBaznvKrynouIWJGFHjtf676onamlnejhu9ikUXmAh/pyp9A46yRSnohBFtoJyr6bKc1GrFZEgSIaVtQA==","signatures":[{"sig":"MEUCICzJBQRFbmL6quX6ArOhp2pEOU7ohpu6OGCyqBFsRb6zAiEAqFxAdnG8l3lg0W0Y2zykwhqKdrVrKlYyKqmVy6jJImw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"wrap-promise.js","_from":".","files":["wrap-promise","lib/*"],"_shasum":"d22c76855e6d4b4012610060421fae1a37ec90b0","gitHead":"952eecaa3f625dcc1687dcf0a897dd718fb3d0df","scripts":{"lint":"eslint .","test":"mocha","pretest":"npm run lint"},"_npmUser":{"name":"braintree","email":"devs@getbraintree.com"},"repository":{"url":"git+https://github.com/braintree/wrap-promise.git","type":"git"},"_npmVersion":"3.10.10","description":"A small lib to return promises or use callbacks","directories":{},"_nodeVersion":"6.10.3","dependencies":{},"devDependencies":{"chai":"^3.5.0","mocha":"^3.2.0","sinon":"^1.17.7","eslint":"^2.7.0","sinon-chai":"^2.8.0","eslint-config-braintree":"^1.0.2"},"_npmOperationalInternal":{"tmp":"tmp/wrap-promise-1.1.1.tgz_1496344021395_0.2482113866135478","host":"s3://npm-registry-packages"}},"2.0.0":{"name":"@braintree/wrap-promise","version":"2.0.0","keywords":[],"author":{"name":"Braintree","email":"code@getbraintree.com"},"license":"MIT","_id":"@braintree/wrap-promise@2.0.0","maintainers":[{"name":"braintree","email":"devs@getbraintree.com"}],"homepage":"https://github.com/braintree/wrap-promise#readme","bugs":{"url":"https://github.com/braintree/wrap-promise/issues"},"dist":{"shasum":"6bf4bd934f18bb1b460bdd608d81154db8d2ff65","tarball":"https://registry.npmjs.org/@braintree/wrap-promise/-/wrap-promise-2.0.0.tgz","fileCount":8,"integrity":"sha512-I9s8c/bHBx7gM04yHGKjRoyqX1NhT4d3RIQjLZDW+yFI3DRmi/8JYDpxQeW4fiU6bWX2f3KV1Oa8r2nwKeaAwA==","signatures":[{"sig":"MEUCIDH1jq9qQi/rJmYrjXkJdDISPgv5LdSfP74JF8sinIZZAiEAzHAsuNgvbtJ2hFMmwIcSt9ROnYhJ9N1eIZrFyXDQu8k=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":6547,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcty1MCRA9TVsSAnZWagAAo6kQAKHQPpfURJunsjLczqMj\niyIEThWmWrSuhomw1b/3aOoX3jx8N7fujX39fGamzGzhYznoUJNd//6iKrqq\nhRHtaW/a7VvD8UWCriv/LWTZzkAhG5dyhfLvfVNfSg/lWcnVjqIhLDmkxtgp\nNMqTGR9VLHFD4n++sLku+dGADMWQqRr9SHZSYhCLs1iWYMBgVc7KAmVgVArF\nxtiu6UM+99XxabB/0/fkhReyRexgwn2COCeKzC3mzNnCZOAj/EHxn3VT+g6Y\nU/k0bswbtlF9B0tZ29QQyh0DJw7t9s58xyKmArflUBsTHuanAjhGhJ6dn3S5\nZzD8UNchYaZQMXatZH6A+vLa17NMcy5YueFT4VsWgu+oX74JOoP0ingo4BJG\nRCv6rB2yXTR/2N+//vUbzYap91ngNcd3eWabpUehwHwFHN1v6ZddWexqCW7z\nQ6dKjru1RPbLtn9rg7+pNGYYkshjbQnh4PjCHO2pS4sXO7lvQaOOA+qxpAl5\nYVTSc1tPvqk13T0oMFoYKCJgwidQvH+g47rXSUUhAuJBUfStyI9R5ezpKX+j\nQDK+Zht0ED8i+2BEDtjgXmWaJ0XhUXHPOU10SkIBcw43Cq9W4XpofksUPOZw\nXbUQAW4Oi/myflWpjGbb37CzmDhl/JmSU6XnEzh7xmRY8hceVG1tq6AFr8GV\niwKn\r\n=VJDo\r\n-----END PGP SIGNATURE-----\r\n"},"main":"wrap-promise.js","gitHead":"889f86d076a794002b927931ddc676f442c5ac66","scripts":{"lint":"eslint .","test":"mocha","pretest":"npm run lint"},"_npmUser":{"name":"braintree","email":"devs+npm@getbraintree.com"},"repository":{"url":"git+https://github.com/braintree/wrap-promise.git","type":"git"},"_npmVersion":"6.4.1","description":"A small lib to return promises or use callbacks","directories":{},"_nodeVersion":"10.15.3","dependencies":{},"_hasShrinkwrap":false,"devDependencies":{"chai":"^4.2.0","mocha":"^6.1.2","sinon":"^7.3.1","eslint":"^5.16.0","sinon-chai":"^3.3.0","eslint-config-braintree":"^2.0.0"},"_npmOperationalInternal":{"tmp":"tmp/wrap-promise_2.0.0_1555508555679_0.7680814418552762","host":"s3://npm-registry-packages"}},"2.1.0":{"name":"@braintree/wrap-promise","version":"2.1.0","keywords":[],"author":{"name":"Braintree","email":"code@getbraintree.com"},"license":"MIT","_id":"@braintree/wrap-promise@2.1.0","maintainers":[{"name":"braintree","email":"devs@getbraintree.com"}],"homepage":"https://github.com/braintree/wrap-promise#readme","bugs":{"url":"https://github.com/braintree/wrap-promise/issues"},"dist":{"shasum":"7e27ffc5dacd2d71533b0c42506eea8e7c2e50fa","tarball":"https://registry.npmjs.org/@braintree/wrap-promise/-/wrap-promise-2.1.0.tgz","fileCount":12,"integrity":"sha512-UIrJB+AfKU0CCfbMoWrsGpd2D/hBpY/SGgFI6WRHPOwhaZ3g9rz1weiJ6eb6L9KgVyunT7s2tckcPkbHw+NzeA==","signatures":[{"sig":"MEUCIQDbfhq3lITi3u0ezY/qwO2RW0/NUvAcHwpo0Tu7LvtLswIgDYRMGF7zKugo80f33Gfyx+DOk+sk8Nwy59dfHiCIHrA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":8456,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfDIAGCRA9TVsSAnZWagAAYmgP/3D2DrTj3VoIEEgLYrAt\n3nf9Jdoat/XGCmkdwKXa95caMJoJNy6JhcpHn1Zo+vcU2YPMJf6ZEXGK1tj9\nWooQ+VpiHEcQP5pK6qCY8kKVkdA+2hpSB/Z+t4fscp29i+d2XxZooSTPjy9q\nv/1se0AMUg8DY501Ele7vb2w9wlqRJ86UgDLGJKJRkao0ebLVzzz1zZ+WEHi\nea/QJgZXvLdC9Mc2LQ+lq+gA0T5XVIBUAQICT83om0gaL7JyTayVGc4F1bTn\nfGwIPxB1GcWkJOZMgdfdBIeyELrNL3g61XsrwkJovijWmwWGbnv8oM2DD/WV\nA0sc55ahVQD0xg27IyAJFzfmBG5+SqNmSnDUQcw0s8ggq3pZNeSsODE/4MvC\nAVefVrI7phehpQAFZjZDLHTmP2C60QOWdgiucoDkvBd/7lZiUHmPLSGSGpKI\nqjFr4mXFtJIo9gT0cjUlINNMr4woO5ginsk0t3Kx7zcg0R9pCP+h+inlGcVO\nrp91swGGkY/27QD3X30DflCGTuzGdneP6LxhX1nKNaAMJBu2xgqppNA2Lgff\n/SIdf1N099fC/hAgU3PkbxyOB/KYAO5fC0UJiA8Y1iFDZPBoRkxRH6Q/qvj3\n04mOlKyosCxD8t7fTD9VzBwMwpGTennL6G9rwTTbpRiF6SkrYFLotTzH4TR2\nPABB\r\n=u/j8\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/wrap-promise.js","types":"dist/wrap-promise.d.ts","gitHead":"8af158277c24a81d7db5f55da0ef48b87f3440d7","scripts":{"lint":"eslint --ext .js,.ts .","test":"jest","build":"tsc --declaration","posttest":"npm run lint","prebuild":"prettier --write .","prepublishOnly":"npm run build"},"_npmUser":{"name":"braintree","email":"team-sdk@getbraintree.com"},"repository":{"url":"git+https://github.com/braintree/wrap-promise.git","type":"git"},"_npmVersion":"6.14.5","description":"A small lib to return promises or use callbacks","directories":{},"_nodeVersion":"12.18.2","dependencies":{},"_hasShrinkwrap":false,"devDependencies":{"jest":"^25.3.0","eslint":"^6.8.0","ts-jest":"^25.3.1","prettier":"^2.0.4","typescript":"^3.8.3","@types/jest":"^25.2.1","eslint-config-braintree":"5.0.0-typescript-prep-rc.17"},"_npmOperationalInternal":{"tmp":"tmp/wrap-promise_2.1.0_1594654726467_0.18967346962520315","host":"s3://npm-registry-packages"}},"3.0.0":{"name":"@braintree/wrap-promise","version":"3.0.0","keywords":[],"author":{"name":"Braintree","email":"code@getbraintree.com"},"license":"MIT","_id":"@braintree/wrap-promise@3.0.0","maintainers":[{"name":"braintree","email":"sdk-package-registries@paypal.com"}],"homepage":"https://github.com/braintree/wrap-promise#readme","bugs":{"url":"https://github.com/braintree/wrap-promise/issues"},"dist":{"shasum":"485fcdfbf17fff3a10267a9d6b4aaad7ff8db0a9","tarball":"https://registry.npmjs.org/@braintree/wrap-promise/-/wrap-promise-3.0.0.tgz","fileCount":13,"integrity":"sha512-ebPq7vVLDCRJBPa0WHx3i3dhB7FdkZkf/TQz20UK54J3TdQXDDzO3cD4NuWiX5zi7NPyXpzWp4ZZBxTb8yRTxg==","signatures":[{"sig":"MEYCIQDd5AvY2i7nnmKRxE0sZ5uGUAdV5by/vAFKT8O2JJLReQIhAISTk4ZZAGQgbF1XF7eaAGDPg9PDhKHHeChqVDaNRBof","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":9232},"main":"dist/wrap-promise.js","types":"dist/wrap-promise.d.ts","gitHead":"0c06f1ce4991a67a7bbbce55f5e1c19f53c442bc","scripts":{"lint":"eslint --ext .js,.ts .","test":"jest","build":"tsc --declaration","posttest":"npm run lint","prebuild":"prettier --write .","prepublishOnly":"npm run build"},"_npmUser":{"name":"braintree","email":"sdk-package-registries@paypal.com"},"repository":{"url":"git+https://github.com/braintree/wrap-promise.git","type":"git"},"_npmVersion":"8.19.2","description":"A small lib to return promises or use callbacks","directories":{},"_nodeVersion":"18.12.1","_hasShrinkwrap":false,"devDependencies":{"jest":"^29.5.0","eslint":"^8.35.0","ts-jest":"^29.0.5","prettier":"^2.8.4","typescript":"^5.1.6","@types/jest":"^29.5.3","eslint-plugin-prettier":"^4.2.1","eslint-config-braintree":"^6.0.0-typescript-prep-rc.2","@typescript-eslint/eslint-plugin":"^5.54.1"},"_npmOperationalInternal":{"tmp":"tmp/wrap-promise_3.0.0_1701805505640_0.7397339610232341","host":"s3://npm-registry-packages"}},"3.0.1":{"name":"@braintree/wrap-promise","version":"3.0.1","keywords":[],"author":{"name":"Braintree","email":"code@getbraintree.com"},"license":"MIT","_id":"@braintree/wrap-promise@3.0.1","maintainers":[{"name":"braintree","email":"sdk-package-registries@paypal.com"}],"homepage":"https://github.com/braintree/wrap-promise#readme","bugs":{"url":"https://github.com/braintree/wrap-promise/issues"},"dist":{"shasum":"d765d1be76f07894df646f10205af7365276fd72","tarball":"https://registry.npmjs.org/@braintree/wrap-promise/-/wrap-promise-3.0.1.tgz","fileCount":11,"integrity":"sha512-3AZgzBwmqDM4gtQ624Q9BtBteV71zYjcteqGkh1FFhbK5BX4jxPiRVi+kNO7HT9salDIahamJAW4zlMslOfbIA==","signatures":[{"sig":"MEYCIQCpkGZ1uHbWhDUpf8ZPlxmjB6Nia6eL4qlbrq2tF/OYZwIhANS24v5aS8iimvcJ/xl/HE9tXcnC8W2YUqwJ7eFbPBjk","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":8673},"main":"dist/wrap-promise.js","types":"dist/wrap-promise.d.ts","gitHead":"88efa7c2af6a0514deec738487a9c254c3d2c807","scripts":{"lint":"eslint --ext .js,.ts .","test":"jest","build":"tsc --declaration","posttest":"npm run lint","prebuild":"prettier --write .","prepublishOnly":"npm run build"},"_npmUser":{"name":"braintree","email":"sdk-package-registries@paypal.com"},"repository":{"url":"git+https://github.com/braintree/wrap-promise.git","type":"git"},"_npmVersion":"10.7.0","description":"A small lib to return promises or use callbacks","directories":{},"_nodeVersion":"18.20.3","_hasShrinkwrap":false,"devDependencies":{"jest":"^29.5.0","eslint":"^8.35.0","ts-jest":"^29.0.5","prettier":"^2.8.4","typescript":"^5.1.6","@types/jest":"^29.5.3","eslint-plugin-prettier":"^4.2.1","eslint-config-braintree":"^6.0.0-typescript-prep-rc.2","@typescript-eslint/eslint-plugin":"^5.54.1"},"_npmOperationalInternal":{"tmp":"tmp/wrap-promise_3.0.1_1718746363004_0.3722870399817608","host":"s3://npm-registry-packages"}},"3.0.2":{"name":"@braintree/wrap-promise","version":"3.0.2","keywords":[],"author":{"name":"Braintree","email":"code@getbraintree.com"},"license":"MIT","_id":"@braintree/wrap-promise@3.0.2","maintainers":[{"name":"braintree","email":"sdk-package-registries@paypal.com"}],"homepage":"https://github.com/braintree/wrap-promise#readme","bugs":{"url":"https://github.com/braintree/wrap-promise/issues"},"dist":{"shasum":"3ba58ba6531e0016b3ca0c89cea2ec613ea847e7","tarball":"https://registry.npmjs.org/@braintree/wrap-promise/-/wrap-promise-3.0.2.tgz","fileCount":11,"integrity":"sha512-9x19oqUaXz6b4nPByoFht555Ybc/I3+sJMGbrNzyIZUvzZCQp/5B6o6Seh3PPIkG2CsAAKiBBLX9V7dn1o2E+Q==","signatures":[{"sig":"MEYCIQCLEs1EiF8yFussgyjyN8I1tosrWuDR3AOfTVfMagkMgwIhAIyW25NtC5ykQ0aDCvTJDnahRJMBp2FBQHFPE/PMtnTH","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":8673},"main":"dist/wrap-promise.js","types":"dist/wrap-promise.d.ts","gitHead":"c57b7c0dca8eeacbcf98d1e8d6d739851732f01f","scripts":{"lint":"eslint --ext .js,.ts .","test":"jest","build":"tsc --declaration","posttest":"npm run lint","prebuild":"prettier --write .","prepublishOnly":"npm run build"},"_npmUser":{"name":"braintree","email":"sdk-package-registries@paypal.com"},"repository":{"url":"git+https://github.com/braintree/wrap-promise.git","type":"git"},"_npmVersion":"10.8.2","description":"A small lib to return promises or use callbacks","directories":{},"_nodeVersion":"18.20.5","_hasShrinkwrap":false,"devDependencies":{"jest":"^29.5.0","eslint":"^8.35.0","ts-jest":"^29.0.5","prettier":"^2.8.4","typescript":"^5.1.6","@types/jest":"^29.5.3","eslint-plugin-prettier":"^4.2.1","eslint-config-braintree":"^6.0.0-typescript-prep-rc.2","@typescript-eslint/eslint-plugin":"^5.54.1"},"_npmOperationalInternal":{"tmp":"tmp/wrap-promise_3.0.2_1734717632332_0.6568756445992372","host":"s3://npm-registry-packages-npm-production"}},"3.0.4":{"name":"@braintree/wrap-promise","version":"3.0.4","description":"A small lib to return promises or use callbacks","main":"dist/wrap-promise.js","types":"dist/wrap-promise.d.ts","devDependencies":{"@types/jest":"^30.0.0","@types/node":"^24.0.0","@typescript-eslint/eslint-plugin":"^5.54.1","eslint":"^8.35.0","eslint-config-braintree":"^6.0.0-typescript-prep-rc.2","eslint-plugin-prettier":"^4.2.1","jest":"^30.2.0","prettier":"^2.8.4","ts-jest":"^29.4.6","typescript":"^5.9.3"},"scripts":{"prepublishOnly":"npm run build","prebuild":"prettier --write .","build":"tsc --declaration","lint":"eslint --ext .js,.ts .","posttest":"npm run lint","test":"jest"},"repository":{"type":"git","url":"git+https://github.com/braintree/wrap-promise.git"},"keywords":[],"author":{"name":"Braintree","email":"code@getbraintree.com"},"license":"MIT","bugs":{"url":"https://github.com/braintree/wrap-promise/issues"},"homepage":"https://github.com/braintree/wrap-promise#readme","gitHead":"3e5ed38b947f16c6ea613035efebdf3af67f7180","_id":"@braintree/wrap-promise@3.0.4","_nodeVersion":"24.11.1","_npmVersion":"11.6.2","dist":{"integrity":"sha512-chRHNyEZycc/rUOBy7ZJxzDoKmwjOLcHrGx9cvGFMRTa9FJhA6PWrlBO4nKMCOYr/AGRg8Aa14f5zRXbRy95lw==","shasum":"ebea301f4271b556fe5facbee4ed862d0cb48d51","tarball":"https://registry.npmjs.org/@braintree/wrap-promise/-/wrap-promise-3.0.4.tgz","fileCount":11,"unpackedSize":8617,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDhsF4WcUlGidmd1xajwnrra5t12K8ZkwG34H54tlXgUgIhAOeBy618+B6RIaCXMEShfXV267W+Cj59xsZVklG/f23f"}]},"_npmUser":{"name":"braintree","email":"sdk-package-registries@paypal.com"},"directories":{},"maintainers":[{"name":"braintree","email":"sdk-package-registries@paypal.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/wrap-promise_3.0.4_1769711684908_0.19620123755026375"},"_hasShrinkwrap":false}},"time":{"created":"2017-06-01T19:07:02.374Z","modified":"2026-01-29T18:34:45.168Z","1.1.1":"2017-06-01T19:07:02.374Z","2.0.0":"2019-04-17T13:42:35.794Z","2.1.0":"2020-07-13T15:38:46.581Z","3.0.0":"2023-12-05T19:45:05.783Z","3.0.1":"2024-06-18T21:32:43.159Z","3.0.2":"2024-12-20T18:00:32.512Z","3.0.4":"2026-01-29T18:34:45.052Z"},"bugs":{"url":"https://github.com/braintree/wrap-promise/issues"},"author":{"name":"Braintree","email":"code@getbraintree.com"},"license":"MIT","homepage":"https://github.com/braintree/wrap-promise#readme","keywords":[],"repository":{"type":"git","url":"git+https://github.com/braintree/wrap-promise.git"},"description":"A small lib to return promises or use callbacks","maintainers":[{"name":"braintree","email":"sdk-package-registries@paypal.com"}],"readme":"# wrap-promise\n\nSmall module to help support APIs that return a promise or use a callback.\n\n### Example\n\n```js\n// my-method.js\nvar wrapPromise = require(\"wrap-promise\");\n\nfunction myMethod(arg) {\n  return new Promise(function (resolve, reject) {\n    doSomethingAsync(arg, function (err, response) {\n      if (err) {\n        reject(err);\n        return;\n      }\n\n      resolve(response);\n    });\n  });\n}\n\nmodule.exports = wrapPromise(myMethod);\n\n// my-app.js\nvar myMethod = require(\"./my-method\");\n\nmyMethod(\"foo\")\n  .then(function (response) {\n    // do something with response\n  })\n  .catch(function (err) {\n    // handle error\n  });\n\nmyMethod(\"foo\", function (err, response) {\n  if (err) {\n    // handle error\n    return;\n  }\n\n  // do something with response\n});\n```\n\n### Wrap All Methods on the Prototype\n\n```js\nfunction MyObject() {}\n\nMyObject.prototype.myAsyncMethod = function () {\n  return new Promise(function (resolve, reject) {\n    //\n  });\n};\n\nMyObject.prototype.myOtherAsyncMethod = function () {\n  return new Promise(function (resolve, reject) {\n    //\n  });\n};\n\nmodule.exports = wrapPromise.wrapPrototype(MyObject);\n```\n\nStatic methods, sync methods on the prototype (though if you pass a function as the last argument of your sync method, you will get an error), and non-function properties on the prototype are ignored.\n\nIf there are certain methods you want ignored, you can pass an `ignoreMethods` array.\n\n```js\nmodule.exports = wrapPromise.wrapPrototype(MyObject, {\n  ignoreMethods: [\"myMethodOnThePrototypeIDoNotWantTransformed\"],\n});\n```\n\nBy default, `wrapPrototype` ignores methods that begin with an underscore. You can override this behavior by passing: `transformPrivateMethods: true`\n\n```js\nmodule.exports = wrapPromise.wrapPrototype(MyObject, {\n  transformPrivateMethods: true,\n});\n```\n","readmeFilename":"README.md"}