{"versions":{"1.0.0":{"name":"callguard","version":"1.0.0","description":"Callback exception guard","author":{"name":"Gustaf Räntilä"},"license":"MIT","bugs":{"url":"https://github.com/grantila/callguard/issues"},"homepage":"https://github.com/grantila/callguard#readme","main":"./dist/index.js","types":"./dist/index.d.ts","directories":{},"scripts":{"build":"rimraf dist && ./node_modules/.bin/tsc -p .","test":"mocha dist/test","buildtest":"npm run build && npm run test"},"repository":{"type":"git","url":"git+https://github.com/grantila/callguard.git"},"keywords":["callguard","call","guard","error","exception","handler"],"devDependencies":{"@types/mocha":"2.x","@types/node":"8.x","chai":"4.x","mocha":"4.x","rimraf":"2.x","sinon":"4.x","typescript":"2.5.x"},"gitHead":"e1996bad21e81de9978a2fd97d75d4d91e444504","_id":"callguard@1.0.0","_npmVersion":"5.3.0","_nodeVersion":"8.5.0","_npmUser":{"name":"anonymous","email":"g.rantila@gmail.com"},"dist":{"integrity":"sha512-0vV2eBeI/f+rRoxUPh+sLc5lIfhC1iEYve+dYgeH/zMSYGPSWwJfRTTQGGO0ylF54ncWOaX4k988Kdsb7+Y+bQ==","shasum":"0e871c1303a0af4397e98584ec178f77bf1a609f","tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/callguard/-/callguard-1.0.0.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIALQ+UzGgYnGd60yoZLw196UAPbdIjNKdOfJ6ihNbToDAiBepOrc3UDtHw2hodcbV61l7ov9kMfRImXDJoiTTpSlxA=="}]},"maintainers":[{"name":"anonymous","email":"g.rantila@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/callguard-1.0.0.tgz_1508968860155_0.45603594928979874"},"contributors":[]},"1.0.1":{"name":"callguard","version":"1.0.1","description":"Callback exception guard","author":{"name":"Gustaf Räntilä"},"license":"MIT","bugs":{"url":"https://github.com/grantila/callguard/issues"},"homepage":"https://github.com/grantila/callguard#readme","main":"./dist/index.js","types":"./dist/index.d.ts","directories":{},"scripts":{"build":"rimraf dist && ./node_modules/.bin/tsc -p .","test":"mocha dist/test","buildtest":"npm run build && npm run test"},"repository":{"type":"git","url":"git+https://github.com/grantila/callguard.git"},"keywords":["callguard","call","guard","error","exception","handler"],"devDependencies":{"@types/mocha":"2.x","@types/node":"8.x","chai":"4.x","mocha":"4.x","rimraf":"2.x","sinon":"4.x","typescript":"2.5.x"},"gitHead":"b6171f8723c284212cd970b25316bb157776dda2","_id":"callguard@1.0.1","_npmVersion":"5.3.0","_nodeVersion":"8.5.0","_npmUser":{"name":"anonymous","email":"g.rantila@gmail.com"},"dist":{"integrity":"sha512-WN5nJ0bJdlTHdHcuktXzWehEetOBWH+bbv0fCinu7YN21iEXsS8VRVHQrDP+QBxZr5IHt4DMXb5k6det2iebyA==","shasum":"17ff3e225874ba841177a0c130f8b838cec09cf8","tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/callguard/-/callguard-1.0.1.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEMmKh1gP78M6LfH2c11cR/GiSKhsG/asluGZIgG/hXzAiAFQETGDsZStFfaPUBnGYQ/4p//wJEeI9oNl2y1rMgYXA=="}]},"maintainers":[{"name":"anonymous","email":"g.rantila@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/callguard-1.0.1.tgz_1508969623257_0.9104558797553182"},"contributors":[]},"1.0.2":{"name":"callguard","version":"1.0.2","description":"Callback exception guard","author":{"name":"Gustaf Räntilä"},"license":"MIT","bugs":{"url":"https://github.com/grantila/callguard/issues"},"homepage":"https://github.com/grantila/callguard#readme","main":"./dist/index.js","types":"./dist/index.d.ts","directories":{},"scripts":{"build":"rimraf dist && ./node_modules/.bin/tsc -p .","test":"mocha dist/test","buildtest":"npm run build && npm run test"},"repository":{"type":"git","url":"git+https://github.com/grantila/callguard.git"},"keywords":["callguard","call","guard","error","exception","handler"],"devDependencies":{"@types/mocha":"2.x","@types/node":"8.x","chai":"4.x","mocha":"4.x","rimraf":"2.x","sinon":"4.x","typescript":"2.5.x"},"gitHead":"c5df8c1a01164b2495b2f56d09e6e994c3820bf9","_id":"callguard@1.0.2","_npmVersion":"5.3.0","_nodeVersion":"8.4.0","_npmUser":{"name":"anonymous","email":"g.rantila@gmail.com"},"dist":{"integrity":"sha512-cDprnxjtwnch79RulPwf1/O46H8wTloqEbxX3oIOQxsIP6EPQCmJ1JDeBygkKbcqnxrC+v9I4ZSNFUhcLEGTlQ==","shasum":"471ec6dadc473f27acc549e9e09ac161ddd00f9d","tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/callguard/-/callguard-1.0.2.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEEHMO2owkUetIjLc57HSIDAOmgwNmiDDeGMXdzjxS3JAiBy7XCHULUtaykHybGEEyQkPc86kjTeLdOLfiC9iMk+fg=="}]},"maintainers":[{"name":"anonymous","email":"g.rantila@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/callguard-1.0.2.tgz_1509007832333_0.4500177763402462"},"contributors":[]},"1.1.0":{"name":"callguard","version":"1.1.0","description":"Callback exception guard","author":{"name":"Gustaf Räntilä"},"license":"MIT","bugs":{"url":"https://github.com/grantila/callguard/issues"},"homepage":"https://github.com/grantila/callguard#readme","main":"./dist/index.js","types":"./dist/index.d.ts","directories":{},"scripts":{"build":"rimraf dist && ./node_modules/.bin/tsc -p .","test":"istanbul cover node_modules/.bin/_mocha -- --bail --check-leaks dist/test","buildtest":"npm run build && npm run test"},"repository":{"type":"git","url":"git+https://github.com/grantila/callguard.git"},"keywords":["callguard","call","guard","error","exception","handler"],"devDependencies":{"@types/mocha":"2.x","@types/node":"8.x","chai":"4.x","coveralls":"2.x","istanbul":"1.1.0-alpha.1","mocha":"4.x","rimraf":"2.x","sinon":"4.x","typescript":"2.5.x"},"gitHead":"a9e3a1bc592c1099fb3386b01e967d15a1e2a330","_id":"callguard@1.1.0","_npmVersion":"5.5.1","_nodeVersion":"8.9.0","_npmUser":{"name":"anonymous","email":"g.rantila@gmail.com"},"dist":{"integrity":"sha512-/fFD4wcW3zF7iLW5k4XZ3PcurWB3Xls6pcXG4jTmrezcOhZm2y6t7G/S04eIow1m2zTiiW9BKSscZxBcd1BLow==","shasum":"e4be36cbd96788689094c76bace3b20dc155119f","tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/callguard/-/callguard-1.1.0.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC+MFSyfrs1WvR6bqWg0CWRp8m+Tobs586dWKowX+xOEgIhAPZI/B1GdK0r7qACm2sfaZzONPShG6ufsCT57J1HOj+r"}]},"maintainers":[{"name":"anonymous","email":"g.rantila@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/callguard-1.1.0.tgz_1512478851182_0.3474554114509374"},"contributors":[]},"1.2.0":{"name":"callguard","version":"1.2.0","description":"Callback exception guard","author":{"name":"Gustaf Räntilä"},"license":"MIT","bugs":{"url":"https://github.com/grantila/callguard/issues"},"homepage":"https://github.com/grantila/callguard#readme","main":"./dist/index.js","types":"./dist/index.d.ts","directories":{},"scripts":{"build":"rimraf dist && ./node_modules/.bin/tsc -p .","mocha":"mocha --bail --check-leaks dist/test","test":"nyc npm run mocha","buildtest":"npm run build && npm run test","travis-deploy-once":"travis-deploy-once","semantic-release":"semantic-release","cz":"git-cz"},"repository":{"type":"git","url":"git+https://github.com/grantila/callguard.git"},"keywords":["callguard","call","guard","error","exception","handler"],"devDependencies":{"@types/chai":"^4.1.7","@types/mocha":"5.x","@types/node":"10.x","@types/sinon":"^7.0.0","chai":"4.x","coveralls":"3.x","cz-conventional-changelog":"2.x","mocha":"5.x","nyc":"13.x","rimraf":"2.x","semantic-release":"15.x","sinon":"7.x","travis-deploy-once":"5.x","typescript":"3.x"},"config":{"commitizen":{"path":"./node_modules/cz-conventional-changelog"}},"gitHead":"13aeb67c845911bf45f08c89a383e9a262c6e62f","_id":"callguard@1.2.0","_npmVersion":"6.5.0","_nodeVersion":"11.4.0","_npmUser":{"name":"anonymous","email":"g.rantila@gmail.com"},"dist":{"integrity":"sha512-kkqMdnW4n5V1xblU2OlI0aF+dLqNGsJlO+qAJ+DwaajBMzCfdJFVC0xu3i0XnyvrURG2oZ8HVVraYvM56NehVQ==","shasum":"ce09944582e02533584ff85ede78612def706363","tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/callguard/-/callguard-1.2.0.tgz","fileCount":9,"unpackedSize":66441,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcFREVCRA9TVsSAnZWagAADZwP/1A86gRlMdNsV2M0DXEh\nNo1KiTAsVTguXV2byBaI0RqeelKiUQr4/Ro9oYXpGtIEfdWgsZUP1vZbeuIS\n7kg+ka6josIfdFIcyOlhYu4XMllQhFtn7aOAnyGB271QPT8CScy3/YAB2EU+\ncpsQiIdwnANtIHR54TZzcdZP5eSMo8W5y2baEVbtfbipEmhVqy0ay5riW8VV\nApV6KPZTcKRpeBJD/c8OBkLmmGFdSZPFGTGqZFFOXXxDL+xTlww/eBSrRYNc\nAsbPvndZApSWBVVG8XV815FynRARAacAz33AtfhEC8XPKRsu/Uyp5fFXVZzb\n62xrvskkbi8xYTkciqDQXhQXTdSZejtmDvXEmcIbYk8EYc5o+JP/9MyvRCP6\n2gFWmXGijNdBUgysh7LzJu5zyD1E13b17M8MmsWoMwpa3/zHH1YJ8LIZt40p\n9X25mKe8gTIdUb6mdQZyjXrlFnZKCuFeI3hdWlIBQZm8XZ2p17KivVBRdQin\nKXw0K9QzefRYUcEHp4ox3NuBbxGzxCHuwDHKXTrYfywQkvI6QtOQuqWxHQYB\nRJH04OAJQrloCj5u84Qy/brc9HsLC3YQXL4ZT4OmrlXRVWHKkwX03OI5Wn2r\npElfaSz3VlFssFaeoEGUEQb1/z/vJo47e0vZRgJ050kCiSzqKLud0TRHV8gg\nyG1F\r\n=EOSS\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC1wbTC6K0jIQPhnSYmO1T7rj8rClXZ4UIjiTuEjYr67QIhANuUmkY8RrGWG+7J2eiBBPYYZPqxtMUk789kjKiAqHw2"}]},"maintainers":[{"name":"anonymous","email":"g.rantila@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/callguard_1.2.0_1544884500768_0.9533205267519644"},"_hasShrinkwrap":false,"contributors":[]},"1.2.1":{"name":"callguard","version":"1.2.1","description":"Callback exception guard","author":{"name":"Gustaf Räntilä"},"license":"MIT","bugs":{"url":"https://github.com/grantila/callguard/issues"},"homepage":"https://github.com/grantila/callguard#readme","main":"./dist/index.js","types":"./dist/index.d.ts","directories":{},"scripts":{"build":"rimraf dist && ./node_modules/.bin/tsc -p .","mocha":"mocha --bail --check-leaks dist/test","test":"nyc npm run mocha","buildtest":"npm run build && npm run test","travis-deploy-once":"travis-deploy-once","semantic-release":"semantic-release","cz":"git-cz"},"repository":{"type":"git","url":"git+https://github.com/grantila/callguard.git"},"keywords":["callguard","call","guard","error","exception","handler"],"devDependencies":{"@types/chai":"^4.1.7","@types/mocha":"5.x","@types/node":"10.x","@types/sinon":"^7.0.0","chai":"4.x","coveralls":"3.x","cz-conventional-changelog":"2.x","mocha":"5.x","nyc":"13.x","rimraf":"2.x","semantic-release":"15.x","sinon":"7.x","travis-deploy-once":"5.x","typescript":"3.x"},"config":{"commitizen":{"path":"./node_modules/cz-conventional-changelog"}},"gitHead":"d2825eefc7a6fc6b3e0b7008ea470d99db3b5abe","_id":"callguard@1.2.1","_npmVersion":"6.5.0","_nodeVersion":"11.4.0","_npmUser":{"name":"anonymous","email":"g.rantila@gmail.com"},"dist":{"integrity":"sha512-QTxtuE+QrPA/ZStfYEf/IL1RqyOEpg3CMKp35oTs4n91WveYjbnbPJ0O2ob+RxhPzOuvb0KgQvYwJzhZ6nswXQ==","shasum":"3d8df2ea91c946abf1c43b7d6abde23d3aecfdbb","tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/callguard/-/callguard-1.2.1.tgz","fileCount":9,"unpackedSize":72580,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcFSO7CRA9TVsSAnZWagAA1NMP/1D/aWa7RrKdwoB/Ale5\nogT8pfO19VnfkErPKe4Gp5F3evbVhUunCgbMI7wgJ6Z1yRA6W1IAFoLly58B\nBzZs3Il7hobUSi9tcLtZIkrb6BIlhKBroyiFaj1DvQ/FZqnQZPHczjLjc4Ii\nw1YgoYaKkz41wqnQytBAV9McROFdsEcpxY4lSy3POmMAogmihiWy+GT2O0ME\n4KT58UHXJQi8QObSqLq0fAJOaAWPeV1rnFVEGuanu1Or+b3eYeRuaHVouCou\n1W7bzZdw0o/dK5yL1NA9zDodY78IaX6UN98b+/kStyvz82QZyq3VuO9WYs9z\nx361XBB50E+kWIYLiztS4CUHQHf/XmIkv/F3dsSPWpxw/BoVoGGQb/k/L1IA\nAwXbtxKx2IL+HLUmu7+eJLWRUPDHPIJ3COfk2aLzyPEsbWBS3CtTBSn55eaW\n2S7fs8AZ31z8oQMOnP6re6a2sRzrttgzn3TYrZ79WwT2PQkGMuc883Y3Ep7T\nPwzpNJLo0mOzngqXOqBCjFuEGcR1apzA1g3n+h+MQM4c26h6M0kx/v3n/yMh\neVOouzrvyCHcJaKUbNCBoDITv/niMlki8F3gexNQWRthuDzXzna+UC2mvPJv\nGpEjcHzpMDS8xlnok8Uo/y445tNfaBKqOVNXQGKi80iNpxI3q83d0L29Q6CR\n1/Sc\r\n=oJ2U\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGd2PDARCU4ymsqsFVaLPbSxcPYkxoVrDFcj8RMmQwYBAiBQFEOJ2DJM/ITTuO7Jn6ldMWvEUK9JxfPTLnBKlJcqxQ=="}]},"maintainers":[{"name":"anonymous","email":"g.rantila@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/callguard_1.2.1_1544889274510_0.7893550718349527"},"_hasShrinkwrap":false,"contributors":[]},"1.2.2":{"name":"callguard","version":"1.2.2","description":"Callback exception guard","author":{"name":"Gustaf Räntilä"},"license":"MIT","bugs":{"url":"https://github.com/grantila/callguard/issues"},"homepage":"https://github.com/grantila/callguard#readme","main":"./dist/index.js","types":"./dist/index.d.ts","directories":{},"scripts":{"build":"rimraf dist && ./node_modules/.bin/tsc -p .","test":"jest --coverage","buildtest":"npm run build && npm run test","cz":"git-cz"},"repository":{"type":"git","url":"git+https://github.com/grantila/callguard.git"},"keywords":["callguard","call","guard","error","exception","handler"],"devDependencies":{"@types/jest":"^26.0.13","@types/node":"14.6.4","cz-conventional-changelog":"3.3.0","jest":"^26.4.2","rimraf":"3.0.2","ts-jest":"^26.3.0","typescript":"4.0.2"},"config":{"commitizen":{"path":"./node_modules/cz-conventional-changelog"}},"gitHead":"f5de07d102caf75c2478a6b2a5b1866e1bd9f67c","_id":"callguard@1.2.2","_nodeVersion":"12.18.3","_npmVersion":"6.14.6","dist":{"integrity":"sha512-mnZSq7LVdYpMBPO+ciQ2seO7kYkenAKAJsvHGmbPjTk7/rsR4HfboAIoxQYq4g5s3M5L9T7jASWrk6Lz+1aH8Q==","shasum":"efe95e3ce0e9ec734e0177d244236098ebc1e880","tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/callguard/-/callguard-1.2.2.tgz","fileCount":6,"unpackedSize":18438,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfUpe8CRA9TVsSAnZWagAAsPoQAKBM+P/CfghoAeraAIXr\nsFTYMtGXwezAVzCN2dpp/Lkse8qeQ1CxBBIXk1FT30qhlZdW0YeamtmJw5+5\nmumZ1rDyQzRVU6tqX39W2ud2eyHd6Htgh6w5vNR8H2g9Vy+z1cuVj69AeaGv\njScfMIDWRpoeDP+4X5OBE6R/Slti0N6nwu6QML/vl0yQKtf8ZwMK+vEbFeIv\n9ZEAWphHssIZ0boxJg3zqTNntq9J8dPr68GnKIHqXBQgJtg6rsU/Bsq47/f4\n3TroD+DjddfTRNs2aDtdOm8bruPUStxMk+G1oEXV1hgWa4WvdZS4l+bDNgUQ\n1CZpHewZ7gduVyf+TLY9WcfWEQLlHriRbPL4TtSjBkUBmCNNIO8puWj2gh00\ns85I6nhihJqAKU4BRAoblXN71XP5YNfuz6OJrBIwaCywLcknv6PCO8T7wgHC\nA0HpbMwHokfFAfYSbIjjuAtUHeewHWmFSn8IRNzubONaM2pJsRWlr/XvaGBq\n7JOtOPM7EGztjxhzQfnVZNrcKQlbxBVNXvCYAfYT4ZyPRYwnllJnwYwirM0A\neRa5eSOe38zedMrdbkoNl4xqlR21Z/I3rHi+suWQcoACjOmJ+54gau5tTiHv\n65C/hhSlZRbxv7bi9Ek3L6WAwcNWxGnqCAT2wpMqaSr9GnksrRURFjrHcAAa\npkz8\r\n=73AU\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCkBdFj+mC/bwtp7N6dAeXKl2k0ExZVKnXBRVOOQY61swIhAJP0U80GYE/7P+SJps+DvkWovvlT2r5skMplqWgThmIQ"}]},"maintainers":[{"name":"anonymous","email":"g.rantila@gmail.com"}],"_npmUser":{"name":"anonymous","email":"g.rantila@gmail.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/callguard_1.2.2_1599248316241_0.18152646412105455"},"_hasShrinkwrap":false,"contributors":[]},"2.0.0":{"name":"callguard","version":"2.0.0","description":"Callback exception guard","author":{"name":"Gustaf Räntilä"},"license":"MIT","bugs":{"url":"https://github.com/grantila/callguard/issues"},"homepage":"https://github.com/grantila/callguard#readme","main":"./dist/index.js","types":"./dist/index.d.ts","directories":{},"scripts":{"build":"rimraf dist && ./node_modules/.bin/tsc -p .","test":"jest --coverage","buildtest":"npm run build && npm run test","cz":"git-cz"},"repository":{"type":"git","url":"git+https://github.com/grantila/callguard.git"},"keywords":["callguard","call","guard","error","exception","handler"],"devDependencies":{"@types/jest":"^26.0.13","@types/node":"14.6.4","cz-conventional-changelog":"3.3.0","jest":"^26.4.2","rimraf":"3.0.2","ts-jest":"^26.3.0","typescript":"4.0.2"},"config":{"commitizen":{"path":"./node_modules/cz-conventional-changelog"}},"gitHead":"97c598dc62ba9b50ad14c6e865b4b445d3a92188","_id":"callguard@2.0.0","_nodeVersion":"12.18.3","_npmVersion":"6.14.6","dist":{"integrity":"sha512-I3nd+fuj20FK1qu00ImrbH+II+8ULS6ioYr9igqR1xyqySoqc3DiHEyUM0mkoAdKeLGg2CtGnO8R3VRQX5krpQ==","shasum":"32f98348ff82cb1dfcf7d1b198108cf4f5b64c1f","tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/callguard/-/callguard-2.0.0.tgz","fileCount":5,"unpackedSize":15192,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfUpibCRA9TVsSAnZWagAAcBMQAJU/1MqXtYYGHDmSXpWk\ndN+3AsGlvMP0prwfiVARTBMJ01C1qcUsKcb2suM0hbLMVtZp11pDPsPS1z8J\nfTtpRpjnRAPO0xU3f1am9wNPBKcuUXsQHIpfot2FysbYf8QWvFcEbi7T4upt\n2VTte/aI4iyROpE1Rswz7TP/fchu/0DrZ5sZ60HSkr1IFnWPmKxTlFuX9pld\ndihmx4TbpDwY8cTI18HDfwECQHpwmDffqdajRsjW/fN32WpJBgimV1tR+i/j\nCUX9ZRzs1mgfz1SRgkqC5H09cv/FtmahTDQR0/gsO8jGRQuZ92GdZhdbxicS\n7awuXfcxRVpaox1EDaQq17fT8cGlRXyQam86rml3RVtg5tikUOziavulOstE\nCGAFM+q8W85XL3QpjnRrjMfVxsmCoU2XZS6cdzfnoYiXXEP5P74ls1Y1Iaie\nx2WffLVRNiqG0HeUnTv4V+2Zu7HJol7Gs3xahuEv8RWJj3EGWDJDI4jYorML\nyW1xYteRZSc9MZKO4zArhAoKzSDhw34sLkxFw1DjDdkKt5Yb75dN6HjOXF14\nExlKDlp+7OQAuBNY3IvrdLJ5bLgelPg1rhq8/Q9AdWCINPyPf52X7X25N6BA\nxLHUIyATzsZYqT5wrzHiYgTpBqlnWQL+OG6Z7xKWnlAweKGX97gkyUNtTa47\nfIaZ\r\n=nZZB\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGLoNGWKyFISkF0a992/XsS7mfaHuhWwj2cg27Pl2TvTAiEAmHWkjfH7Cs+TlCObH5KCPdK9csyceGZZkcUbOEJRcPM="}]},"maintainers":[{"name":"anonymous","email":"g.rantila@gmail.com"}],"_npmUser":{"name":"anonymous","email":"g.rantila@gmail.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/callguard_2.0.0_1599248539528_0.008753809373860166"},"_hasShrinkwrap":false,"contributors":[]}},"dist-tags":{"latest":"2.0.0"},"name":"callguard","time":{"modified":"2022-01-26T20:30:35.716Z","created":"2022-01-26T20:30:35.716Z","1.0.0":"2017-10-25T22:01:01.126Z","1.0.1":"2017-10-25T22:13:44.141Z","1.0.2":"2017-10-26T08:50:33.248Z","1.1.0":"2017-12-05T13:00:52.121Z","1.2.0":"2018-12-15T14:35:00.946Z","1.2.1":"2018-12-15T15:54:34.664Z","1.2.2":"2020-09-04T19:38:36.341Z","2.0.0":"2020-09-04T19:42:19.665Z"},"readme":"[![npm version][npm-image]][npm-url]\n[![downloads][downloads-image]][npm-url]\n[![build status][travis-image]][travis-url]\n[![coverage status][coverage-image]][coverage-url]\n\n# Your callback exception guard\n\n## Rationale\n\nWhen using API's with callback support, the 3rd party module will call your function. Most of Node.js' asynchronous functions work like this. If you unintentionally throw an exception there, you won't know what happens - what is that module supposed to do?\n\nPromises are a solution to this, as they propagate the error back to you transparently through the *promise chain*, but arbitrary callbacks lack this defined flow.\n\nThere are other situations where callbacks are used, and where promises won't automatically solve the handling of exceptions.\n\nTo ensure you don't throw back in a callback, guard your callback function with either `syncGuard` or `asyncGuard`.\n\n\n# Usage\n\n\n## Import\n\n```ts\nimport { syncGuard, asyncGuard } from 'callguard'\n// or\nconst { syncGuard, asyncGuard } = require( 'callguard' );\n```\n\n\n## API\n\n`callguard` exports two functions, `syncGuard` and `asyncGuard`. The former **guards** against synchronous exceptions (but can catch asynchronous too), while the latter **guard** against both.\n\nFor callbacks that either expect no particular return value, or a synchronous value, use `syncGuard` (optionally enable `catchAsync`), and for callbacks that are allowed (and expected) to returned synchronously **or** asynchronously (through promises), use `asyncGuard`.\n\nCreate the guards using these functions and provide an error handler (and optionally options).\n\n```ts\nconst sGuard = syncGuard( errorHandler[, options ] ); // synchronous guard\nconst aGuard = asyncGuard( errorHandler[, options ] ); // asynchronous guard\n```\n\nThe returned values are function wrappers that takes a function as input, and returns a new one as output. The returned functions are safe in that they will not throw. Asynchronously guarded functions will not returned rejected promises either. The guards can be re-used as many times as necessary, both the wrapped functions, as well as the wrapper generators (`sGuard` and `aGuard` in this example). They are all stateless.\n\n```ts\nfs.open( 'file', 'r', sGuard( myCallback ) );\n// and for asynchronous calls:\ntranslateThing( thing, aGuard( myAsyncTranslator ) );\n```\n\nBy default, the value returned from guarded functions when an error was detected, is `null`. This can be altered using the `defaultReturn` option.\n\nWhen debugging an unwanted exception (caught by these guards), it may be hard to know where it came from. To get longer stack traces from the guards construction, usage and call, enable `longStackTraces`. This has a severe performance impact (even in success-flow where no exceptions are thrown!), so you probably only want this when debugging.\n\nThese are the function signatures and the default options:\n\n```ts\nsyncGuard(\n    errorHandler,\n    {\n        defaultReturn: null,\n        longStackTraces: false,\n        catchAsync: false,\n    }\n);\n\nasyncGuard(\n    errorHandler,\n    {\n        defaultReturn: null,\n        longStackTraces: false,\n    }\n);\n```\n\n\n## Example\n\nConsider the following unsafe code. What if `doSomethingWithFd` throws? Maybe this logic is within another module we don't have control over...\n\n```ts\nfs.open( 'my-file', 'r', ( err, fd ) =>\n{\n    // We REALLY don't want to throw here\n    doSomethingWithFd( fd ); // Please don't throw!\n});\n```\n\nTurn it into:\n\n```ts\n// Create a synchronous guard, forward exceptions to console.error.\n// This is just an example, you might want other logic.\nconst guard = syncGuard( console.error.bind( console ) );\n\nfs.open( 'my-file', 'r', guard( ( err, fd ) =>\n{\n    // We really shouldn't throw here, it is not logically sound\n    doSomethingWithFd( fd ); // But it's guarded anyway, so we're safe\n} ) );\n```\n\nNow, if `doSomethingWithFd` would throw, this wouldn't propagate to the `fs.open` function, but instead be printed to the console.\n\n\n## Promisification\n\nOne typical example is when using promises in a codebase, but needing to react to callbacks. In this case, it would often be a bug to throw in the callback, and if this is wrapped in a `new Promise( )` function body, the promise can easily be canceled while the callback remains exception safe.\n\nNOTE; It will probably be expected that the promise can be rejected, but only because `otherLib` fails/throws, not that the logic *here* throws (that's a handling error). `callguard` will not *fix* such bugs in your code, but **it will** ensure you can **safely handle it** in the promise chain.\n\n```ts\nconst p = new Promise( ( resolve, reject ) =>\n{\n    // Map mistakes in throwing back at <otherLib> to this promise rejection\n    const guard = syncGuard( reject );\n\n    otherLib.on( 'data', guard( data =>\n    {\n        // We can handle data here, and if we throw, it will reject <p>\n        doStuffWithData( data ); // This is safe\n    } ) );\n\n    otherLib.on( 'end', guard( ( ) =>\n    {\n        // Also safe callback, also guarded.\n        // If assembleData throws, the promise will be rejected.\n        resolve( assembleData( ) ); // This is safe\n    } ) );\n\n    otherLib.on( 'error', reject ); // Not everything must be guarded\n} );\n```\n\n[npm-image]: https://img.shields.io/npm/v/callguard.svg\n[npm-url]: https://npmjs.org/package/callguard\n[downloads-image]: https://img.shields.io/npm/dm/callguard.svg\n[travis-image]: https://img.shields.io/travis/grantila/callguard.svg\n[travis-url]: https://travis-ci.org/grantila/callguard\n[coverage-image]: https://coveralls.io/repos/github/grantila/callguard/badge.svg?branch=master\n[coverage-url]: https://coveralls.io/github/grantila/callguard?branch=master","users":{}}