{"_id":"promise.try","_rev":"9-1d7e98b3420b400e0e81775253df459d","name":"promise.try","dist-tags":{"latest":"2.0.2"},"versions":{"1.0.0":{"name":"promise.try","version":"1.0.0","keywords":["Promise","promises","try","promise.try","ES7","ES8","ES2017","shim","polyfill","es-shim API"],"author":{"name":"Jordan Harband"},"license":"MIT","_id":"promise.try@1.0.0","maintainers":[{"name":"ljharb","email":"ljharb@gmail.com"}],"contributors":[{"url":"http://ljharb.codes","name":"Jordan Harband","email":"ljharb@gmail.com"}],"homepage":"https://github.com/es-shims/Promise.try#readme","bugs":{"url":"https://github.com/es-shims/Promise.try/issues"},"dist":{"shasum":"d458b3a8dfeb3c8f497fcea10d30cc97eb950d1a","tarball":"https://registry.npmjs.org/promise.try/-/promise.try-1.0.0.tgz","integrity":"sha512-U9xiMAgNLG3EAV2FXM7fFEBchqBB0i6kRdo2GlBfimao6MYEOdokxTJvIA0AaVu8MzuTY7oD3vj2wTOpVde/WQ==","signatures":[{"sig":"MEQCIFmHUyL1nbEUcoFI5Q+0VqcNNiiHSoAwEsk3vBrFVbhPAiAZoYepedch3sXN+2TAQqHzljvYhKY8QGpHFn9QRR6teg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"index.js","_from":".","_shasum":"d458b3a8dfeb3c8f497fcea10d30cc97eb950d1a","engines":{"node":">= 0.4"},"gitHead":"9b4642e54d2a12b7cdcfac572a17d3d764edf9d4","scripts":{"lint":"eslint test/*.js *.js","test":"npm run --silent tests-only","pretest":"npm run --silent lint","coverage":"covert test/*.js","posttest":"npm run --silent security","security":"nsp check","tests:es5":"npm run --silent test:promise-shimmed","tests-only":"es-shim-api --bound && npm run --silent test:shimmed && npm run --silent test:module && npm run --silent tests:es5","test:module":"node test/index.js","xprepublish":"safe-publish-latest","test:shimmed":"node test/shimmed.js","coverage-quiet":"covert test/*.js --quiet","test:promise-shimmed":"node test/promise-shimmed.js"},"_npmUser":{"name":"ljharb","email":"ljharb@gmail.com"},"testling":{"files":"test/index.js","browsers":["iexplore/9.0..latest","firefox/4.0..6.0","firefox/15.0..latest","firefox/nightly","chrome/4.0..10.0","chrome/20.0..latest","chrome/canary","opera/11.6..latest","opera/next","safari/5.0..latest","ipad/6.0..latest","iphone/6.0..latest","android-browser/4.2"]},"repository":{"url":"git://github.com/es-shims/Promise.try.git","type":"git"},"_npmVersion":"3.10.3","description":"ES Proposal spec-compliant shim for Promise.try","directories":{},"_nodeVersion":"6.4.0","dependencies":{"es-abstract":"^1.6.1","function-bind":"^1.1.0","define-properties":"^1.1.2"},"devDependencies":{"nsp":"^2.6.1","tape":"^4.6.0","covert":"^1.1.0","eslint":"^3.3.1","es6-shim":"^0.35.1","for-each":"^0.3.2","@es-shims/api":"^1.2.0","object-inspect":"^1.2.1","safe-publish-latest":"^1.0.1","@ljharb/eslint-config":"^7.0.0"},"_npmOperationalInternal":{"tmp":"tmp/promise.try-1.0.0.tgz_1471774087541_0.7309370874427259","host":"packages-16-east.internal.npmjs.com"}},"2.0.0":{"name":"promise.try","version":"2.0.0","keywords":["Promise","promises","try","Promise.try","shim","polyfill","es-shim API"],"author":{"name":"Jordan Harband"},"license":"MIT","_id":"promise.try@2.0.0","maintainers":[{"name":"ljharb","email":"ljharb@gmail.com"}],"contributors":[{"url":"http://ljharb.codes","name":"Jordan Harband","email":"ljharb@gmail.com"}],"homepage":"https://github.com/es-shims/Promise.try#readme","bugs":{"url":"https://github.com/es-shims/Promise.try/issues"},"dist":{"shasum":"ddb5c26623ff2e076d3e3cb8f9a1c1f9aa8b2f25","tarball":"https://registry.npmjs.org/promise.try/-/promise.try-2.0.0.tgz","fileCount":20,"integrity":"sha512-qxavc+m8X5vGiMwhBJ6sMKEakPJObSlmvmk0UJ5tPabQJqItw8NClsYsxzi8JjT+0sAOk6bNYEKtwVWbvklVHQ==","signatures":[{"sig":"MEUCIHOZ80sEH8N1yrWyAa2l2RDfrIHWHm272wP0odP28kWFAiEA2QnOVnAlfRzYnajKnQMxDXDWkmVuN+cWAMtOz/AnpAA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":18636},"main":"index.js","engines":{"node":">= 0.4"},"exports":{".":"./index.js","./auto":"./auto.js","./shim":"./shim.js","./polyfill":"./polyfill.js","./package.json":"./package.json","./implementation":"./implementation.js"},"gitHead":"c0cb81299097368e455a9150f67e36bb5baefeb3","scripts":{"lint":"eslint .","test":"npm run --silent tests-only","prelint":"evalmd README.md","prepack":"npmignore --auto --commentLines=autogenerated","pretest":"npm run --silent lint","version":"auto-changelog && git add CHANGELOG.md","postlint":"es-shim-api --bound","posttest":"aud --production","prepublish":"safe-publish-latest","tests-only":"nyc tape test/{implementation,index,shimmed}.js","postversion":"auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\"","prepublishOnly":"safe-publish-latest","test:promise-shimmed":"node test/promise-shimmed.js"},"_npmUser":{"name":"ljharb","email":"ljharb@gmail.com"},"testling":{"files":"test/index.js"},"repository":{"url":"git://github.com/es-shims/Promise.try.git","type":"git"},"_npmVersion":"10.5.0","description":"ES Proposal spec-compliant shim for Promise.try","directories":{},"_nodeVersion":"21.7.2","dependencies":{"call-bind":"^1.0.7","es-errors":"^1.3.0","es-abstract":"^1.23.3","auto-changelog":"^2.4.0","define-properties":"^1.2.1","set-function-name":"^2.0.2"},"publishConfig":{"ignore":[".github/workflows"]},"_hasShrinkwrap":false,"auto-changelog":{"output":"CHANGELOG.md","template":"keepachangelog","hideCredit":true,"unreleased":false,"commitLimit":false,"backfillLimit":false},"devDependencies":{"aud":"^2.0.4","nyc":"^10.3.2","tape":"^5.7.5","eslint":"=8.8.0","evalmd":"^0.0.19","es6-shim":"^0.35.8","for-each":"^0.3.3","npmignore":"^0.3.1","@es-shims/api":"^2.5.0","object-inspect":"^1.13.1","safe-publish-latest":"^1.1.3","functions-have-names":"^1.2.3","@ljharb/eslint-config":"^21.1.0"},"_npmOperationalInternal":{"tmp":"tmp/promise.try_2.0.0_1712689460074_0.8797955807203817","host":"s3://npm-registry-packages"}},"2.0.1":{"name":"promise.try","version":"2.0.1","keywords":["Promise","promises","try","Promise.try","shim","polyfill","es-shim API"],"author":{"name":"Jordan Harband"},"license":"MIT","_id":"promise.try@2.0.1","maintainers":[{"name":"ljharb","email":"ljharb@gmail.com"}],"contributors":[{"url":"http://ljharb.codes","name":"Jordan Harband","email":"ljharb@gmail.com"}],"homepage":"https://github.com/es-shims/Promise.try#readme","bugs":{"url":"https://github.com/es-shims/Promise.try/issues"},"dist":{"shasum":"5bfb1a2b56ef7a297277dc0fde9a06120f96711f","tarball":"https://registry.npmjs.org/promise.try/-/promise.try-2.0.1.tgz","fileCount":20,"integrity":"sha512-7Lvq1rrywExCch6Uyw8P5G0HrgYs1u2rxY+0HFBMoA5IqndrJrSGc+ybRnPY1N78F8x+j9BaOWNbg7bzTMG9NA==","signatures":[{"sig":"MEUCIQDSErAGkzl2UvO060+BGmaZL3nPBThR4iPbUgr3VhoRAgIgOenlJH0gdLyQLiu7ErOL6GePfdtCK+LF67jMxZyflnY=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":20222},"main":"index.js","engines":{"node":">= 0.4"},"exports":{".":"./index.js","./auto":"./auto.js","./shim":"./shim.js","./polyfill":"./polyfill.js","./package.json":"./package.json","./implementation":"./implementation.js"},"gitHead":"8771cb1191e79e7aa6ea8744270f753ddcbed9cb","scripts":{"lint":"eslint .","test":"npm run --silent tests-only","prelint":"evalmd README.md","prepack":"npmignore --auto --commentLines=autogenerated","pretest":"npm run --silent lint","version":"auto-changelog && git add CHANGELOG.md","postlint":"es-shim-api --bound","posttest":"npx npm@\">= 10.2\" audit --production","prepublish":"not-in-publish || npm run prepublishOnly","tests-only":"nyc tape test/{implementation,index,shimmed}.js","postversion":"auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\"","prepublishOnly":"safe-publish-latest","test:promise-shimmed":"node test/promise-shimmed.js"},"_npmUser":{"name":"ljharb","email":"ljharb@gmail.com"},"testling":{"files":"test/index.js"},"repository":{"url":"git://github.com/es-shims/Promise.try.git","type":"git"},"_npmVersion":"11.6.2","description":"ES Proposal spec-compliant shim for Promise.try","directories":{},"_nodeVersion":"25.2.1","dependencies":{"call-bind":"^1.0.8","es-errors":"^1.3.0","es-abstract":"^1.24.1","define-properties":"^1.2.1","set-function-name":"^2.0.2"},"publishConfig":{"ignore":[".github/workflows"]},"_hasShrinkwrap":false,"auto-changelog":{"output":"CHANGELOG.md","template":"keepachangelog","hideCredit":true,"unreleased":false,"commitLimit":false,"backfillLimit":false},"devDependencies":{"nyc":"^10.3.2","jiti":"^0.0.0","tape":"^5.9.0","eslint":"^9.39.2","evalmd":"^0.0.19","encoding":"^0.1.13","es6-shim":"^0.35.8","for-each":"^0.3.5","npmignore":"^0.3.5","in-publish":"^2.0.1","@es-shims/api":"^2.5.1","auto-changelog":"^2.5.0","object-inspect":"^1.13.4","safe-publish-latest":"^2.0.0","functions-have-names":"^1.2.3","@ljharb/eslint-config":"^22.1.3"},"_npmOperationalInternal":{"tmp":"tmp/promise.try_2.0.1_1767366672417_0.9091084916843217","host":"s3://npm-registry-packages-npm-production"}},"2.0.2":{"_id":"promise.try@2.0.2","bugs":{"url":"https://github.com/es-shims/Promise.try/issues"},"dist":{"shasum":"61a93667ab98b4eb684ebc9367f4d3d9a73a5f2c","tarball":"https://registry.npmjs.org/promise.try/-/promise.try-2.0.2.tgz","integrity":"sha512-v52t0zwjhZX4x52T69jDMO11oKAt6l7NosmY+H+3MD7s16iXUYbFrA+DOcW5rvl+mBIWJAFbbTaExDxPUgaowg==","fileCount":10,"unpackedSize":14852,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIGG1062QaurOf6rvOjK+n73N279Ke09M8bbkXCXGSnu0AiBiAQkA5fKno8/x8zuVwdkozizcpN5zOpto6+H7Un6vhQ=="}]},"main":"index.js","name":"promise.try","author":{"name":"Jordan Harband"},"engines":{"node":">= 0.4"},"exports":{".":"./index.js","./auto":"./auto.js","./shim":"./shim.js","./polyfill":"./polyfill.js","./package.json":"./package.json","./implementation":"./implementation.js"},"gitHead":"fa34b403b6a1d506d637db1219875bf8dd77226e","license":"MIT","scripts":{"lint":"eslint .","test":"npm run --silent tests-only","prelint":"evalmd README.md","prepack":"npmignore --auto --commentLines=autogenerated","pretest":"npm run --silent lint","version":"auto-changelog && git add CHANGELOG.md","postlint":"es-shim-api --bound","posttest":"npx npm@\">= 10.2\" audit --production","prepublish":"not-in-publish || npm run prepublishOnly","tests-only":"nyc tape test/{implementation,index,shimmed}.js","postversion":"auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\"","prepublishOnly":"safe-publish-latest","test:promise-shimmed":"node test/promise-shimmed.js"},"version":"2.0.2","_npmUser":{"name":"ljharb","email":"ljharb@gmail.com","approver":{"name":"ljharb","email":"ljharb@gmail.com"}},"homepage":"https://github.com/es-shims/Promise.try#readme","keywords":["Promise","promises","try","Promise.try","shim","polyfill","es-shim API"],"testling":{"files":"test/index.js"},"repository":{"url":"git://github.com/es-shims/Promise.try.git","type":"git"},"_npmVersion":"11.19.0","description":"ES Proposal spec-compliant shim for Promise.try","directories":{},"maintainers":[{"name":"ljharb","email":"ljharb@gmail.com"}],"_nodeVersion":"26.8.1","contributors":[{"url":"http://ljharb.codes","name":"Jordan Harband","email":"ljharb@gmail.com"}],"dependencies":{"call-bind":"^1.0.9","es-errors":"^1.3.0","es-abstract":"^1.24.2","define-properties":"^1.2.1","set-function-name":"^2.0.2"},"publishConfig":{"ignore":[".editorconfig",".github/workflows",".nycrc","eslint.config.mjs","test"]},"auto-changelog":{"output":"CHANGELOG.md","template":"keepachangelog","hideCredit":true,"unreleased":false,"commitLimit":false,"backfillLimit":false},"devDependencies":{"nyc":"^10.3.2","jiti":"^0.0.0","tape":"^5.10.2","eslint":"^9.39.5","evalmd":"^0.0.22","encoding":"^0.1.13","es6-shim":"^0.35.8","for-each":"^0.3.5","npmignore":"^0.3.5","in-publish":"^2.0.1","@es-shims/api":"^2.5.1","auto-changelog":"^2.6.1","object-inspect":"^1.13.4","safe-publish-latest":"^2.0.0","functions-have-names":"^1.2.3","@ljharb/eslint-config":"^22.2.4"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/promise.try_2.0.2_1788920822079_0.8427576081448909"},"_hasShrinkwrap":false}},"time":{"created":"2016-08-21T10:08:10.188Z","modified":"2026-09-09T02:27:02.361Z","1.0.0":"2016-08-21T10:08:10.188Z","2.0.0":"2024-04-09T19:04:20.232Z","2.0.1":"2026-01-02T15:11:12.601Z","2.0.2":"2026-09-09T02:27:02.174Z"},"bugs":{"url":"https://github.com/es-shims/Promise.try/issues"},"author":{"name":"Jordan Harband"},"license":"MIT","homepage":"https://github.com/es-shims/Promise.try#readme","keywords":["Promise","promises","try","Promise.try","shim","polyfill","es-shim API"],"repository":{"url":"git://github.com/es-shims/Promise.try.git","type":"git"},"description":"ES Proposal spec-compliant shim for Promise.try","contributors":[{"url":"http://ljharb.codes","name":"Jordan Harband","email":"ljharb@gmail.com"}],"maintainers":[{"name":"ljharb","email":"ljharb@gmail.com"}],"readme":"# promise.try <sup>[![Version Badge][npm-version-svg]][package-url]</sup>\n\n[![github actions][actions-image]][actions-url]\n[![coverage][codecov-image]][codecov-url]\n[![License][license-image]][license-url]\n[![Downloads][downloads-image]][downloads-url]\n\n[![npm badge][npm-badge-png]][package-url]\n\nES Proposal spec-compliant shim for `Promise.try`. Invoke its \"shim\" method to shim `Promise.try` if it is unavailable or noncompliant. **Note**: a global `Promise` must already exist: the [es6-shim](https://github.com/es-shims/es6-shim) is recommended.\n\nThis package implements the [es-shim API](https://github.com/es-shims/api) interface. It works in an ES3-supported environment that has `Promise` available globally, and complies with the [proposed spec](https://tc39.es/proposal-promise-try/).\n\nMost common usage:\n```js\nvar assert = require('assert');\nvar promiseTry = require('promise.try');\n\npromiseTry(function (e) {\n\tthrow e;\n}, 42).catch(function (e) {\n\tassert.equal(e, 42);\n});\n\npromiseTry(function () {\n\treturn Infinity;\n}).then(function (x) {\n\tassert.equal(x, Infinity);\n});\n\npromiseTry.shim(); // will be a no-op if not needed\n\nPromise.try(function () {\n\tthrow 42;\n}).catch(function (e) {\n\tassert.equal(e, 42);\n});\n\nPromise.try(function () {\n\treturn Infinity;\n}).then(function (x) {\n\tassert.equal(x, Infinity);\n});\n```\n\n## Tests\nSimply clone the repo, `npm install`, and run `npm test`\n\n[package-url]: https://npmjs.com/package/promise.try\n[npm-version-svg]: http://versionbadg.es/es-shims/Promise.try.svg\n[deps-svg]: https://david-dm.org/es-shims/Promise.try.svg\n[deps-url]: https://david-dm.org/es-shims/Promise.try\n[dev-deps-svg]: https://david-dm.org/es-shims/Promise.try/dev-status.svg\n[dev-deps-url]: https://david-dm.org/es-shims/Promise.try#info=devDependencies\n[testling-svg]: https://ci.testling.com/es-shims/Promise.try.png\n[testling-url]: https://ci.testling.com/es-shims/Promise.try\n[npm-badge-png]: https://nodei.co/npm/promise.try.png?downloads=true&stars=true\n[license-image]: http://img.shields.io/npm/l/promise.try.svg\n[license-url]: LICENSE\n[downloads-image]: http://img.shields.io/npm/dm/promise.try.svg\n[downloads-url]: http://npm-stat.com/charts.html?package=promise.try\n[codecov-image]: https://codecov.io/gh/es-shims/Promise.try/branch/main/graphs/badge.svg\n[codecov-url]: https://app.codecov.io/gh/es-shims/Promise.try/\n[actions-image]: https://img.shields.io/github/check-runs/es-shims/Promise.try/main\n[actions-url]: https://github.com/es-shims/Promise.try/actions\n","readmeFilename":"README.md"}