{"_id":"@aegisjsproject/attempt","_rev":"7-6d261c1e7e0db43dd3f2113b0e4bf405","name":"@aegisjsproject/attempt","dist-tags":{"latest":"1.0.7"},"versions":{"1.0.0":{"name":"@aegisjsproject/attempt","version":"1.0.0","keywords":["try","catch","try-catch","error","async"],"author":{"name":"Chris Zuber","email":"admin@kernvalley.us"},"license":"MIT","_id":"@aegisjsproject/attempt@1.0.0","maintainers":[{"name":"shgysk8zer0","email":"shgysk8zer0@gmail.com"}],"homepage":"https://github.com/AegisJSProject/attempt#readme","bugs":{"url":"https://github.com/AegisJSProject/attempt/issues"},"dist":{"shasum":"99d2bb50cac2bfe758af0d5b2e8e3281250700a6","tarball":"https://registry.npmjs.org/@aegisjsproject/attempt/-/attempt-1.0.0.tgz","fileCount":8,"integrity":"sha512-Q1KjhDorn7BysX+GN/C46syAkxHLH/KV8HyAC6LbiBNXkYu3vdC/KLfuRLLies1gpBhd2vhy57F15HeJL6kh0Q==","signatures":[{"sig":"MEUCIQChVkbpyGSs4VuJYV4Pvd4v9uWyjy+PUBpMASWAPcIm4AIgagWEepOpquZyp49waQ2wvEx2bpzlkW5+Yt8lQjpA3+A=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@aegisjsproject%2fattempt@1.0.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":47146},"main":"./attempt.cjs","type":"module","unpkg":"./attempt.min.js","module":"./attempt.js","engines":{"node":">=18.0.0"},"exports":{".":{"import":"./attempt.js","require":"./attempt.cjs"},"./*":{"import":"./*.js","require":"./*.cjs"},"./*.js":{"import":"./*.js","require":"./*.cjs"},"./*.cjs":{"import":"./*.js","require":"./*.cjs"},"./*.mjs":{"import":"./*.js","require":"./*.cjs"}},"funding":[{"url":"https://liberapay.com/shgysk8zer0","type":"librepay"},{"url":"https://github.com/sponsors/shgysk8zer0","type":"github"}],"gitHead":"b8fdf2e93177603272af4b6629f9b6510ae793bf","private":false,"scripts":{"test":"npm run lint:js && npm run run:tests","build":"npm run build:js","clean":"rm -f ./*.cjs","fix:js":"eslint . --fix","lint:js":"eslint .","prepare":"npm test && npm run build","build:js":"npm run clean && rollup -c rollup.config.js","coverage":"node --test --experimental-test-coverage","run:tests":"node --test","preversion":"npm test && npm run build","create:lock":"npm i --package-lock-only --ignore-scripts --no-audit --no-fund","version:bump":"npm run version:bump:patch","version:bump:major":"npm version --no-git-tag-version major && npm run create:lock","version:bump:minor":"npm version --no-git-tag-version minor && npm run create:lock","version:bump:patch":"npm version --no-git-tag-version patch && npm run create:lock"},"_npmUser":{"name":"shgysk8zer0","email":"shgysk8zer0@gmail.com"},"repository":{"url":"git+https://github.com/AegisJSProject/attempt.git","type":"git"},"_npmVersion":"10.1.0","description":"Run synchronous and asynchronous code without throwing errors","directories":{},"_nodeVersion":"20.9.0","_hasShrinkwrap":false,"devDependencies":{"eslint":"^9.31.0","rollup":"^4.45.1","@rollup/plugin-terser":"^0.4.4","@shgysk8zer0/polyfills":"^0.4.12","@shgysk8zer0/eslint-config":"^1.0.4"},"_npmOperationalInternal":{"tmp":"tmp/attempt_1.0.0_1752703013918_0.557204605913673","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@aegisjsproject/attempt","version":"1.0.1","keywords":["try","catch","try-catch","error","async"],"author":{"name":"Chris Zuber","email":"admin@kernvalley.us"},"license":"MIT","_id":"@aegisjsproject/attempt@1.0.1","maintainers":[{"name":"shgysk8zer0","email":"shgysk8zer0@gmail.com"}],"homepage":"https://github.com/AegisJSProject/attempt#readme","bugs":{"url":"https://github.com/AegisJSProject/attempt/issues"},"dist":{"shasum":"ecc502869165e3dc0cb4c7fdfc5a289574a1dd55","tarball":"https://registry.npmjs.org/@aegisjsproject/attempt/-/attempt-1.0.1.tgz","fileCount":8,"integrity":"sha512-nWagKqy+JOtlTQi7/oZfblKZyG97AwEQrj7hg7FnW8K/7dPQwt9WEvbWzmRZjUzntt+/jEeT7k4hO7Q9WOaMzQ==","signatures":[{"sig":"MEUCIQD56ttdFQH7Ksl4rwEuyK+miuCdemekR2qSGYPYCb4aUQIgdfauFylSilqH1lCatPYmsnNEnfB2efondSucP36y9Rc=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@aegisjsproject%2fattempt@1.0.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":54438},"main":"./attempt.cjs","type":"module","unpkg":"./attempt.min.js","module":"./attempt.js","engines":{"node":">=18.0.0"},"exports":{".":{"import":"./attempt.js","require":"./attempt.cjs"},"./*":{"import":"./*.js","require":"./*.cjs"},"./*.js":{"import":"./*.js","require":"./*.cjs"},"./*.cjs":{"import":"./*.js","require":"./*.cjs"},"./*.mjs":{"import":"./*.js","require":"./*.cjs"}},"funding":[{"url":"https://liberapay.com/shgysk8zer0","type":"librepay"},{"url":"https://github.com/sponsors/shgysk8zer0","type":"github"}],"gitHead":"b2248f2fafe6b83d16fe43c56ac879eb2fd2892c","private":false,"scripts":{"test":"npm run lint:js && npm run run:tests","build":"npm run build:js","clean":"rm -f ./*.cjs","fix:js":"eslint . --fix","lint:js":"eslint .","prepare":"npm test && npm run build","build:js":"npm run clean && rollup -c rollup.config.js","coverage":"node --test --experimental-test-coverage","run:tests":"node --test","preversion":"npm test && npm run build","create:lock":"npm i --package-lock-only --ignore-scripts --no-audit --no-fund","version:bump":"npm run version:bump:patch","version:bump:major":"npm version --no-git-tag-version major && npm run create:lock","version:bump:minor":"npm version --no-git-tag-version minor && npm run create:lock","version:bump:patch":"npm version --no-git-tag-version patch && npm run create:lock"},"_npmUser":{"name":"shgysk8zer0","email":"shgysk8zer0@gmail.com"},"repository":{"url":"git+https://github.com/AegisJSProject/attempt.git","type":"git"},"_npmVersion":"10.1.0","description":"Run synchronous and asynchronous code without throwing errors","directories":{},"_nodeVersion":"20.9.0","_hasShrinkwrap":false,"devDependencies":{"eslint":"^9.31.0","rollup":"^4.45.1","@rollup/plugin-terser":"^0.4.4","@shgysk8zer0/polyfills":"^0.4.12","@shgysk8zer0/eslint-config":"^1.0.4"},"_npmOperationalInternal":{"tmp":"tmp/attempt_1.0.1_1753207017054_0.533460208088989","host":"s3://npm-registry-packages-npm-production"}},"1.0.2":{"name":"@aegisjsproject/attempt","version":"1.0.2","keywords":["try","catch","try-catch","error","async"],"author":{"name":"Chris Zuber","email":"admin@kernvalley.us"},"license":"MIT","_id":"@aegisjsproject/attempt@1.0.2","maintainers":[{"name":"shgysk8zer0","email":"shgysk8zer0@gmail.com"}],"homepage":"https://github.com/AegisJSProject/attempt#readme","bugs":{"url":"https://github.com/AegisJSProject/attempt/issues"},"dist":{"shasum":"bf9c48e4ab694dec564a6857a47e74376f47d1f6","tarball":"https://registry.npmjs.org/@aegisjsproject/attempt/-/attempt-1.0.2.tgz","fileCount":8,"integrity":"sha512-XGehmc19pdp1a+X5Bx/jYYCG3V4l0jpQzHPcnw9BFQ8/bk5W1Gi45Sc/Ake0N+cw407rNRzkzSwFTx44TgUzDw==","signatures":[{"sig":"MEQCIHHeb6H6AV4lIMcCz1vB384ME9VDy9WH5phHFGeJLKU1AiACdz5MTmvY74ePVuYJXbTI6K2mMCdWv/dScJtz2hJcEA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@aegisjsproject%2fattempt@1.0.2","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":57650},"main":"./attempt.cjs","type":"module","unpkg":"./attempt.min.js","module":"./attempt.js","engines":{"node":">=18.0.0"},"exports":{".":{"import":"./attempt.js","require":"./attempt.cjs"},"./*":{"import":"./*.js","require":"./*.cjs"},"./*.js":{"import":"./*.js","require":"./*.cjs"},"./*.cjs":{"import":"./*.js","require":"./*.cjs"},"./*.mjs":{"import":"./*.js","require":"./*.cjs"}},"funding":[{"url":"https://liberapay.com/shgysk8zer0","type":"librepay"},{"url":"https://github.com/sponsors/shgysk8zer0","type":"github"}],"gitHead":"a702ee44965764fedfd1058a5288fa225f9ac19b","private":false,"scripts":{"test":"npm run lint:js && npm run run:tests","build":"npm run build:js","clean":"rm -f ./*.cjs","fix:js":"eslint . --fix","lint:js":"eslint .","prepare":"npm test && npm run build","build:js":"npm run clean && rollup -c rollup.config.js","coverage":"node --test --experimental-test-coverage","run:tests":"node --test","preversion":"npm test && npm run build","create:lock":"npm i --package-lock-only --ignore-scripts --no-audit --no-fund","version:bump":"npm run version:bump:patch","version:bump:major":"npm version --no-git-tag-version major && npm run create:lock","version:bump:minor":"npm version --no-git-tag-version minor && npm run create:lock","version:bump:patch":"npm version --no-git-tag-version patch && npm run create:lock"},"_npmUser":{"name":"shgysk8zer0","email":"shgysk8zer0@gmail.com"},"repository":{"url":"git+https://github.com/AegisJSProject/attempt.git","type":"git"},"_npmVersion":"10.1.0","description":"Run synchronous and asynchronous code without throwing errors","directories":{},"_nodeVersion":"20.9.0","_hasShrinkwrap":false,"devDependencies":{"eslint":"^9.31.0","rollup":"^4.45.1","@rollup/plugin-terser":"^0.4.4","@shgysk8zer0/polyfills":"^0.4.12","@shgysk8zer0/eslint-config":"^1.0.4"},"_npmOperationalInternal":{"tmp":"tmp/attempt_1.0.2_1753288039537_0.34550341320485534","host":"s3://npm-registry-packages-npm-production"}},"1.0.3":{"name":"@aegisjsproject/attempt","version":"1.0.3","keywords":["try","catch","try-catch","error","async"],"author":{"name":"Chris Zuber","email":"admin@kernvalley.us"},"license":"MIT","_id":"@aegisjsproject/attempt@1.0.3","maintainers":[{"name":"shgysk8zer0","email":"shgysk8zer0@gmail.com"}],"homepage":"https://github.com/AegisJSProject/attempt#readme","bugs":{"url":"https://github.com/AegisJSProject/attempt/issues"},"dist":{"shasum":"dedcb3778493c87cc6a93f61fc25e0402c329f36","tarball":"https://registry.npmjs.org/@aegisjsproject/attempt/-/attempt-1.0.3.tgz","fileCount":8,"integrity":"sha512-lbjSaYt5I4p7SP0ziGQnyVqiYxXmtEMUWd+UbEV6nnlrZjXsIAua/Rrw5+AhUZJKLdM9s0E43Je0++mZvg5oIA==","signatures":[{"sig":"MEUCIAtF5CV6V4YJejbhKsS73AKfZjO2eaHHdCdN8QvovnCTAiEA0yU2Z+7kWKIu59F1+uP4miw7mpCxvY/S23pVxpB8HwI=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@aegisjsproject%2fattempt@1.0.3","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":61801},"main":"./attempt.cjs","type":"module","unpkg":"./attempt.min.js","module":"./attempt.js","engines":{"node":">=18.0.0"},"exports":{".":{"import":"./attempt.js","require":"./attempt.cjs"},"./*":{"import":"./*.js","require":"./*.cjs"},"./*.js":{"import":"./*.js","require":"./*.cjs"},"./*.cjs":{"import":"./*.js","require":"./*.cjs"},"./*.mjs":{"import":"./*.js","require":"./*.cjs"}},"funding":[{"url":"https://liberapay.com/shgysk8zer0","type":"librepay"},{"url":"https://github.com/sponsors/shgysk8zer0","type":"github"}],"gitHead":"5d21064e367f9f203a7dd9f2caafb6d4506cab9c","private":false,"scripts":{"test":"npm run lint:js && npm run run:tests","build":"npm run build:js","clean":"rm -f ./*.cjs","fix:js":"eslint . --fix","lint:js":"eslint .","prepare":"npm test && npm run build","build:js":"npm run clean && rollup -c rollup.config.js","coverage":"node --test --experimental-test-coverage","run:tests":"node --test","preversion":"npm test && npm run build","create:lock":"npm i --package-lock-only --ignore-scripts --no-audit --no-fund","version:bump":"npm run version:bump:patch","version:bump:major":"npm version --no-git-tag-version major && npm run create:lock","version:bump:minor":"npm version --no-git-tag-version minor && npm run create:lock","version:bump:patch":"npm version --no-git-tag-version patch && npm run create:lock"},"_npmUser":{"name":"shgysk8zer0","email":"shgysk8zer0@gmail.com"},"repository":{"url":"git+https://github.com/AegisJSProject/attempt.git","type":"git"},"_npmVersion":"10.1.0","description":"Run synchronous and asynchronous code without throwing errors","directories":{},"_nodeVersion":"20.9.0","_hasShrinkwrap":false,"devDependencies":{"eslint":"^9.31.0","rollup":"^4.45.1","@rollup/plugin-terser":"^0.4.4","@shgysk8zer0/polyfills":"^0.4.12","@shgysk8zer0/eslint-config":"^1.0.4"},"_npmOperationalInternal":{"tmp":"tmp/attempt_1.0.3_1753891294518_0.17707963562072893","host":"s3://npm-registry-packages-npm-production"}},"1.0.4":{"name":"@aegisjsproject/attempt","version":"1.0.4","keywords":["try","catch","try-catch","error","async"],"author":{"name":"Chris Zuber","email":"admin@kernvalley.us"},"license":"MIT","_id":"@aegisjsproject/attempt@1.0.4","maintainers":[{"name":"shgysk8zer0","email":"shgysk8zer0@gmail.com"}],"homepage":"https://github.com/AegisJSProject/attempt#readme","bugs":{"url":"https://github.com/AegisJSProject/attempt/issues"},"dist":{"shasum":"0ee3824d8e81981200e2e5cde3ad3c122150a9b7","tarball":"https://registry.npmjs.org/@aegisjsproject/attempt/-/attempt-1.0.4.tgz","fileCount":8,"integrity":"sha512-+a8SVTQ7eNdEvS14tnkVRdH+3KNofbkRABlpPxbpFubrCCMU5IN4uwz5FnCe0WO12rvHCWBk1fqy2QOHx08eiQ==","signatures":[{"sig":"MEUCIDPtZ+sg9eDgbIi0gZ4yYF7fRqCzvfYnVQYAx6gWFj95AiEAxuwPIdEU++YGrd6vbSWYIkiwo+m+ot5jEdPFRVTYkyg=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@aegisjsproject%2fattempt@1.0.4","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":65191},"main":"./attempt.cjs","type":"module","unpkg":"./attempt.min.js","module":"./attempt.js","engines":{"node":">=18.0.0"},"exports":{".":{"import":"./attempt.js","require":"./attempt.cjs"},"./*":{"import":"./*.js","require":"./*.cjs"},"./*.js":{"import":"./*.js","require":"./*.cjs"},"./*.cjs":{"import":"./*.js","require":"./*.cjs"},"./*.mjs":{"import":"./*.js","require":"./*.cjs"}},"funding":[{"url":"https://liberapay.com/shgysk8zer0","type":"librepay"},{"url":"https://github.com/sponsors/shgysk8zer0","type":"github"}],"gitHead":"090d9697231cc8c630b9656daacdb6140bb7573b","private":false,"scripts":{"test":"npm run lint:js && npm run run:tests","build":"npm run build:js","clean":"rm -f ./*.cjs","fix:js":"eslint . --fix","lint:js":"eslint .","prepare":"npm test && npm run build","build:js":"npm run clean && rollup -c rollup.config.js","coverage":"node --test --experimental-test-coverage","run:tests":"node --test","preversion":"npm test && npm run build","create:lock":"npm i --package-lock-only --ignore-scripts --no-audit --no-fund","version:bump":"npm run version:bump:patch","version:bump:major":"npm version --no-git-tag-version major && npm run create:lock","version:bump:minor":"npm version --no-git-tag-version minor && npm run create:lock","version:bump:patch":"npm version --no-git-tag-version patch && npm run create:lock"},"_npmUser":{"name":"shgysk8zer0","email":"shgysk8zer0@gmail.com"},"repository":{"url":"git+https://github.com/AegisJSProject/attempt.git","type":"git"},"_npmVersion":"10.1.0","description":"Run synchronous and asynchronous code without throwing errors","directories":{},"_nodeVersion":"20.9.0","_hasShrinkwrap":false,"devDependencies":{"eslint":"^9.31.0","rollup":"^4.45.1","@rollup/plugin-terser":"^0.4.4","@shgysk8zer0/polyfills":"^0.4.12","@shgysk8zer0/eslint-config":"^1.0.4"},"_npmOperationalInternal":{"tmp":"tmp/attempt_1.0.4_1754611146336_0.0569931381040516","host":"s3://npm-registry-packages-npm-production"}},"1.0.5":{"name":"@aegisjsproject/attempt","version":"1.0.5","keywords":["try","catch","try-catch","error","async"],"author":{"name":"Chris Zuber","email":"admin@kernvalley.us"},"license":"MIT","_id":"@aegisjsproject/attempt@1.0.5","maintainers":[{"name":"shgysk8zer0","email":"shgysk8zer0@gmail.com"}],"homepage":"https://github.com/AegisJSProject/attempt#readme","bugs":{"url":"https://github.com/AegisJSProject/attempt/issues"},"dist":{"shasum":"c7bb75ff37e3ff1862f048b273294fd1cf6f9885","tarball":"https://registry.npmjs.org/@aegisjsproject/attempt/-/attempt-1.0.5.tgz","fileCount":8,"integrity":"sha512-v4ZsZ39+HjN7SVbyDNPi5IMK2BYzyZyKZ+eaxhGMqJp95IH9+oY0Gf/QcWwMR5Dso7uWsEHgLuSiVhh2A7WxOQ==","signatures":[{"sig":"MEUCIQC55oiBCTFPKs2ZsPgk5RCdjMOg4sy5+oHF5h0m/7Xv1AIgJbWvJrU6VM2MQz7PdGWCaKYKzcYRxZ5ZEf+VHIF+248=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@aegisjsproject%2fattempt@1.0.5","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":65182},"main":"./attempt.cjs","type":"module","unpkg":"./attempt.min.js","module":"./attempt.js","engines":{"node":">=18.0.0"},"exports":{".":{"import":"./attempt.js","require":"./attempt.cjs"},"./*":{"import":"./*.js","require":"./*.cjs"},"./*.js":{"import":"./*.js","require":"./*.cjs"},"./*.cjs":{"import":"./*.js","require":"./*.cjs"},"./*.mjs":{"import":"./*.js","require":"./*.cjs"}},"funding":[{"url":"https://liberapay.com/shgysk8zer0","type":"librepay"},{"url":"https://github.com/sponsors/shgysk8zer0","type":"github"}],"gitHead":"b8613da55605153d9b5e30b0ccff6a65b88c10af","private":false,"scripts":{"test":"npm run lint:js && npm run run:tests","build":"npm run build:js","clean":"rm -f ./*.cjs","fix:js":"eslint . --fix","lint:js":"eslint .","prepare":"npm test && npm run build","build:js":"npm run clean && rollup -c rollup.config.js","coverage":"node --test --experimental-test-coverage","run:tests":"node --test","preversion":"npm test && npm run build","create:lock":"npm i --package-lock-only --ignore-scripts --no-audit --no-fund","version:bump":"npm run version:bump:patch","version:bump:major":"npm version --no-git-tag-version major && npm run create:lock","version:bump:minor":"npm version --no-git-tag-version minor && npm run create:lock","version:bump:patch":"npm version --no-git-tag-version patch && npm run create:lock"},"_npmUser":{"name":"shgysk8zer0","email":"shgysk8zer0@gmail.com"},"repository":{"url":"git+https://github.com/AegisJSProject/attempt.git","type":"git"},"_npmVersion":"10.1.0","description":"Run synchronous and asynchronous code without throwing errors","directories":{},"_nodeVersion":"20.9.0","_hasShrinkwrap":false,"devDependencies":{"eslint":"^9.31.0","rollup":"^4.45.1","@rollup/plugin-terser":"^0.4.4","@shgysk8zer0/polyfills":"^0.4.12","@shgysk8zer0/eslint-config":"^1.0.4"},"_npmOperationalInternal":{"tmp":"tmp/attempt_1.0.5_1754856603361_0.6694835895759026","host":"s3://npm-registry-packages-npm-production"}},"1.0.7":{"name":"@aegisjsproject/attempt","version":"1.0.7","description":"Run synchronous and asynchronous code without throwing errors","keywords":["try","catch","try-catch","error","async"],"type":"module","main":"./attempt.cjs","module":"./attempt.js","unpkg":"./attempt.min.js","exports":{".":{"import":"./attempt.js","require":"./attempt.cjs"},"./*.js":{"import":"./*.js","require":"./*.cjs"},"./*.mjs":{"import":"./*.js","require":"./*.cjs"},"./*.cjs":{"import":"./*.js","require":"./*.cjs"},"./*":{"import":"./*.js","require":"./*.cjs"}},"engines":{"node":">=18.0.0"},"private":false,"scripts":{"test":"npm run lint:js && npm run run:tests","preversion":"npm test && npm run build","prepare":"npm test && npm run build","lint:js":"eslint .","fix:js":"eslint . --fix","build":"npm run build:js","run:tests":"node --test","coverage":"node --test --experimental-test-coverage","clean":"rm -f ./*.cjs","build:js":"npm run clean && rollup -c rollup.config.js","create:lock":"npm i --package-lock-only --ignore-scripts --no-audit --no-fund","version:bump":"npm run version:bump:patch","version:bump:patch":"npm version --no-git-tag-version patch && npm run create:lock","version:bump:minor":"npm version --no-git-tag-version minor && npm run create:lock","version:bump:major":"npm version --no-git-tag-version major && npm run create:lock"},"repository":{"type":"git","url":"git+https://github.com/AegisJSProject/attempt.git"},"author":{"name":"Chris Zuber","email":"admin@kernvalley.us"},"license":"MIT","funding":[{"type":"librepay","url":"https://liberapay.com/shgysk8zer0"},{"type":"github","url":"https://github.com/sponsors/shgysk8zer0"}],"bugs":{"url":"https://github.com/AegisJSProject/attempt/issues"},"homepage":"https://github.com/AegisJSProject/attempt#readme","devDependencies":{"@rollup/plugin-terser":"^0.4.4","@shgysk8zer0/eslint-config":"^1.0.7","@shgysk8zer0/polyfills":"^0.6.2","eslint":"^10.0.2","rollup":"^4.59.0"},"gitHead":"713c39936f160e98e7d6122305d17449de35ab8c","_id":"@aegisjsproject/attempt@1.0.7","_nodeVersion":"24.10.0","_npmVersion":"11.6.1","dist":{"integrity":"sha512-vt23jnoN14aUf50ekvOflncx7f3JNgmjzytW/81uXCGOWti9Qj/yayfn8FqKM48fea6SiYnNbQv5eaeL7513gQ==","shasum":"e6792939b715323b46df15806aba4a65b465368a","tarball":"https://registry.npmjs.org/@aegisjsproject/attempt/-/attempt-1.0.7.tgz","fileCount":8,"unpackedSize":70396,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@aegisjsproject%2fattempt@1.0.7","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCnCYVzNWKXZSKXSRdYiClU2hHIxehLVv15a0GRvovY6gIhANbu7P3vkQ2P46FHlM1p3e0GzV/QDIAdm5PRPmAfmqF1"}]},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:f5e9c7c1-17ea-42bf-8d95-9a08bf3f2673"}},"directories":{},"maintainers":[{"name":"shgysk8zer0","email":"shgysk8zer0@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/attempt_1.0.7_1772563371214_0.11295071176729565"},"_hasShrinkwrap":false}},"time":{"created":"2025-07-16T21:56:53.850Z","modified":"2026-03-03T18:42:51.639Z","1.0.0":"2025-07-16T21:56:54.091Z","1.0.1":"2025-07-22T17:56:57.290Z","1.0.2":"2025-07-23T16:27:19.717Z","1.0.3":"2025-07-30T16:01:34.703Z","1.0.4":"2025-08-07T23:59:06.507Z","1.0.5":"2025-08-10T20:10:03.572Z","1.0.7":"2026-03-03T18:42:51.353Z"},"bugs":{"url":"https://github.com/AegisJSProject/attempt/issues"},"author":{"name":"Chris Zuber","email":"admin@kernvalley.us"},"license":"MIT","homepage":"https://github.com/AegisJSProject/attempt#readme","keywords":["try","catch","try-catch","error","async"],"repository":{"type":"git","url":"git+https://github.com/AegisJSProject/attempt.git"},"description":"Run synchronous and asynchronous code without throwing errors","maintainers":[{"name":"shgysk8zer0","email":"shgysk8zer0@gmail.com"}],"readme":"# @aegisjsproject/attempt\n\nRun synchronous and asynchronous code without throwing errors.\n\nThis is a *tiny* (about 1kb when minified & gzipped) library to help avoid `try / catch` and uncaught errors.\nIt has 100% test coverage and extensive JSDocs.\n\n[![CodeQL](https://github.com/AegisJSProject/attempt/actions/workflows/codeql-analysis.yml/badge.svg)](https://github.com/AegisJSProject/attempt/actions/workflows/codeql-analysis.yml)\n![Node CI](https://github.com/AegisJSProject/attempt/workflows/Node%20CI/badge.svg)\n![Lint Code Base](https://github.com/AegisJSProject/attempt/workflows/Lint%20Code%20Base/badge.svg)\n\n[![GitHub license](https://img.shields.io/github/license/AegisJSProject/attempt.svg)](https://github.com/AegisJSProject/attempt/blob/master/LICENSE)\n[![GitHub last commit](https://img.shields.io/github/last-commit/AegisJSProject/attempt.svg)](https://github.com/AegisJSProject/attempt/commits/master)\n[![GitHub release](https://img.shields.io/github/release/AegisJSProject/attempt?logo=github)](https://github.com/AegisJSProject/attempt/releases)\n[![GitHub Sponsors](https://img.shields.io/github/sponsors/shgysk8zer0?logo=github)](https://github.com/sponsors/shgysk8zer0)\n\n[![npm](https://img.shields.io/npm/v/@aegisjsproject/attempt)](https://www.npmjs.com/package/@aegisjsproject/attempt)\n![node-current](https://img.shields.io/node/v/@aegisjsproject/attempt)\n![npm bundle size gzipped](https://img.shields.io/bundlephobia/minzip/@aegisjsproject/attempt)\n[![npm](https://img.shields.io/npm/dw/@aegisjsproject/attempt?logo=npm)](https://www.npmjs.com/package/@aegisjsproject/attempt)\n\n[![GitHub followers](https://img.shields.io/github/followers/shgysk8zer0.svg?style=social)](https://github.com/shgysk8zer0)\n![GitHub forks](https://img.shields.io/github/forks/AegisJSProject/attempt.svg?style=social)\n![GitHub stars](https://img.shields.io/github/stars/AegisJSProject/attempt.svg?style=social)\n[![Twitter Follow](https://img.shields.io/twitter/follow/shgysk8zer0.svg?style=social)](https://twitter.com/shgysk8zer0)\n\n[![Donate using Liberapay](https://img.shields.io/liberapay/receives/shgysk8zer0.svg?logo=liberapay)](https://liberapay.com/shgysk8zer0/donate \"Donate using Liberapay\")\n- - -\n\n- [Code of Conduct](./.github/CODE_OF_CONDUCT.md)\n- [Contributing](./.github/CONTRIBUTING.md)\n<!-- - [Security Policy](./.github/SECURITY.md) -->\n\n## Bulletproof Error Handling for Modern JavaScript\n\n**Tiny footprint, maximum utility.** At ~1KB, this library provides comprehensive error handling without bloating your bundle - essential for performance-critical applications.\n\n**Zero runtime overhead for success cases.** Unlike try-catch blocks that require stack unwinding, successful operations return immediately with lightweight frozen tuples.\n\n**Bulletproof error normalization.** All errors become proper `Error` objects with consistent structure, preventing the security and debugging issues that come from arbitrary thrown values.\n\n**Functional composition ready.** The Result pattern enables clean error handling in pipelines without breaking function composition or requiring nested exception handling.\n\n**Idempotent operations.** `succeed()` and `fail()` safely handle already-wrapped results, preventing double-wrapping bugs common in complex error handling chains.\n\n**Sync/async parity.** Identical APIs for synchronous and asynchronous operations mean consistent error handling patterns across your entire codebase.\n\n**Immutable by design.** All results are frozen tuples with hidden metadata, preventing accidental mutations while maintaining type safety through symbol-based internal state.\n\n**Production-hardened.** 100% test coverage, security-focused implementation, and battle-tested patterns borrowed from languages like Rust and Go.\n\n## Installation\n\n### NPM\n```bash\nnpm i @aegisjsproject/attempt\n```\n\n### Using [`<script type=\"importmap\">`](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/script/type/importmap)\n\n```html\n<script type=\"importmap\">\n  {\n    \"imports\": {\n      \"@aegisjsproject/attempt\": \"https://unpkg.com/@aegisjsproject/attempt@1.0.5/attempt.min.js\"\n    }\n  }\n</script>\n```\n\n## The Simple API\n\n| helper                                                | description                                                                                          |\n| ----------------------------------------------------- | ---------------------------------------------------------------------------------------------------- |\n| **`attemptAsync(fn, …args)`**<br>`attempt(fn, …args)` | Runs `fn` (sync or async) via `Promise.try`. **Returns:** `Promise<[value, error]>`.                 |\n| **`attemptSync(fn, …args)`**                          | Runs a **synchronous** function. **Returns:** `[value, error]`. Throws `TypeError` if `fn` is async. |\n| **`createSafeAsyncCallback(fn)`**                     | Decorates any function once → returns a proxy that **always** yields `Promise<[value, error]>`.      |\n| **`createSafeSyncCallback(fn)`**                      | Decorates a *sync* function → returns a proxy that yields `[value, error]`.                          |\n| **`createSafeCallback`**                              | Alias of `createSafeAsyncCallback`.                                                                  |\n| **`succeed(value)`/`ok(value)`**                      | Force a frozen `[value, null]` tuple.                                                  |\n| **`fail(err)`/`err(error)`**                          | Force a frozen `[null, Error]` tuple (normalises non‑Error throws).                                  |\n| **`isAttemptResult(result)`**                         | Checks is a value is a valid `[value, error]` tuple as created by `succeed()` or `fail()`.           |\n| **`succeeded(result)`**                               | Checks is a value is a valid `[value, null]` tuple as created by `succeed()`.                        |\n| **`failed(result)`**                                  | Checks is a value is a valid `[null, error]` tuple as created by `fail()`.                           |\n| **`getResultValue(result)`**                          | Gets the `AttemptResult` value of a successful result.                                               |\n| **`getResultError(result)`**                          | Gets the `AttemptResult` error of a failed result.                                                   |\n| **`handleResultAsync(result, { success, failure })`** | Handles an `AttemptResult` asynchronously by invoking the appropriate callback.                      |\n| **`handleResultSync(result, { success, failure })`**  | Handles an `AttemptResult` synchronously by invoking the appropriate callback.                       |\n| **`throwIfFailed(result)`**                           | Handle errors the typical `try/catch` way by throwing the error in an `AttemptFailure`.              |\n| **`attemptAll(...callbacks)`**                        | Attempts to execute multiple callbacks sequentially, passing the result of each callback to the next.|\n\n## Requirements\n\nThis library requires [Promise.try()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/try) to work.\nAs of July of 2025, it has > 80% support, and polyfills are simple and readily available.\n\n## Usage Examples\n\n### As an `AttemptResult`\n\nFor best type safety, `@aegisjsproject/attempt` can deal with results directly, with methods for checking\nresult status, extracting values/errors from a result, etc.\n\n```js\nimport { succeed, fail, succeeded, failed, getResultValue, getResultError } from '@aegisjsproject/attempt';\n\nconst result = Math.random() < 0.5 ? succeed('That number is ok') : fail(new RangeError('Number was too small'));\n\nif (succeeded(result)) {\n  const msg = getResultValue(result);\n  // Handle result value\n} else if (failed(result)) {\n  // could just be an `else` but IDEs do better using `failed` as it ensures it's an `AttemptFailure`\n  const err = getResultError(result);\n  // Handle result error\n}\n```\n\n### `AttemptResult` in more tradtional OOP style\n\n```js\nimport { attemptSync } from '@aegisjsproject/attempt';\n\nconst unsafeFunction = (num) => {\n  if (num > 0.5) {\n    throw new RangeError(`${num} is greater than 0.5`);\n  } else {\n    return num;\n  }\n};\n\nconst result = attemptSync(unsafeFunction, Math.random());\n\nif (result.ok) {\n  // result.value is the return value of the function\n  const num = result.value;\n  // Handle result value\n} else {\n  // result.error is an Error instance\n  const err = result.error;\n  // Handle result error\n}\n```\n\n### With destructuring of `[val, err]` or `{ value, error }`\n\nSince an `AttemptResult` is a frozen tuple of `[val, err]`, you also have the option to just destructure\nit and handle results in what may be a more familiar or convenient way.\n\n```js\nimport { attemptAsync, createSafeSyncCallback, createSafeAsyncCallback } from '@aegisjsproject/attempt';\n\nconst unsafeFunction = (num) => {\n  if (num > 0.5) {\n    throw new Error(`${num} is greater than 0.5`);\n  } else {\n    return num;\n  }\n};\n\nconst safeFunction = createSafeSyncCallback(unsafeFunction);\nconst safeParse = createSafeSyncCallback(JSON.parse);\nconst safeFetch = createSafeAsyncCallback(async (url, init) => {\n  const resp = await fetch(url, init);\n\n  if (resp.ok) {\n    return await resp.json();\n  } else {\n    throw new Error(`${resp.url} [${resp.status}]`);\n  }\n});\n\nconst [num, err] = safeFunction(Math.random()); // 50% chance of throwing, but it'll return the error instead\nsafeParse('{Invalid JSON}');\nconst { value, error, status, ok } = await safeFetch('/api', { method: 'GET' });\n\nconst [value, error, ok] = await attemptAsync(fetch, '/api', { signal: AbortSignal.abort('Request cancelled') });\nif (error) { … }           // always an Error instance\nelse       { …value… }     // may be any value (even null/undefined)\n```\n\n### Using `attemptAll()`\n\n```js\nimport { attemptAll } from '@aegisjsproject/attempt';\n\nconst [sri] = await attemptAll(\n  () => import('node:fs/promises'),\n  fs => fs.readFile('/path/to/file.txt', 'utf8'),\n  text => new TextEncoder().encode(text),\n  encoded => crypto.subtle.digest('SHA-256', encoded),\n  hash => new Uint8Array(hash),\n  bytes => bytes.toBase64(),\n  hash => `sha256-${hash}`\n);\n```\n","readmeFilename":"README.md"}