{"_id":"itty-router-extras","_rev":"18-22bdf5dfca50adb6a2dbce21691af461","name":"itty-router-extras","dist-tags":{"latest":"0.4.6","next":"0.3.0-next.2"},"versions":{"0.1.0":{"name":"itty-router-extras","version":"0.1.0","description":"An assortment of delicious extras for the calorie-light itty-router.","main":"./dist/index.js","types":"./dist/index.d.ts","keywords":["router","cloudflare","workers","serverless","express","regex","routing","api","handler","params","middleware","nested","rest","crud","query","paramaters"],"scripts":{"lint":"npx eslint src","test":"yarn lint && jest --verbose --coverage src","verify":"echo 'verifying module...' && yarn build && yarn test","dev":"yarn lint && jest --verbose --watch src","coveralls":"cat ./coverage/lcov.info | node node_modules/.bin/coveralls","prerelease":"yarn verify","prebuild":"rimraf dist","build":"terser-folder src -eo dist --pattern '**/*.js,!**/*spec.js' -x .js","release":"release --tag --push"},"repository":{"type":"git","url":"git+https://github.com/kwhitley/itty-router-extras.git"},"author":{"name":"Kevin R. Whitley","email":"krwhitley@gmail.com"},"license":"MIT","bugs":{"url":"https://github.com/kwhitley/itty-router-extras/issues"},"homepage":"https://github.com/kwhitley/itty-router-extras#readme","devDependencies":{"chalk":"^4.1.0","coveralls":"^3.1.0","eslint":"^7.22.0","eslint-plugin-jest":"^24.3.2","fs-extra":"^9.1.0","gzip-size":"^6.0.0","isomorphic-fetch":"^3.0.0","itty-router":"^2.1.9","jest":"^26.6.3","rimraf":"^3.0.2","terser":"^5.6.1","terser-folder":"^2.0.0","yarn-release":"^1.10.3"},"licenseText":"MIT License\n\nCopyright (c) 2020 Kevin R. Whitley\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"itty-router-extras@0.1.0","dist":{"shasum":"a59d9784bccf693e7e658590b93ff94ffb9b81d4","integrity":"sha512-vvJpflOCJcba20b5yf8uQcU54X6Rw6QdMfkRhe3BEnznR4Z4/4AOe4/jurhpHVP851htXf45+0C3tnOShTx7/A==","tarball":"https://registry.npmjs.org/itty-router-extras/-/itty-router-extras-0.1.0.tgz","fileCount":24,"unpackedSize":12055,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgXi6wCRA9TVsSAnZWagAA5gAQAJlAMbpozZEbR7MFCuSZ\n51qoi9jppP1d8mYpBkt2f2m2B+6Zme0bKdQdAxQuIsbiz+mpY4r6jwxgIHDX\nU/XKMfsnOv/xj9ney2ycrvUUdWtMQiJKWyU7btzWJTIYxGgNx8yZy5Alk8xg\nDW3xhnCCJXFDbQgFkdopP5e6EBmpsapNwVtNw/xdAallAlhzyfonLQGsXo9m\n9E/NPILbqqGt2R5maOHsMXBer1NAHN0e6DlyK9EW2jS/Im1KDw4SsU2BaX9/\nzS6g3mns4kmAb5kSKmQwVUUm8aZzHDjLQa9ri4eCx00BBjre4mxKuBb6MrOt\nH55T/9vcfLoAiwiRpNuGnyXXuP1OWJ0RddkCsA+hXs6oxRPa+v3sAZjyCbRE\nbmSAHq+KB8ozVeLqNOpKr1nhN3s+7qCBuWr7ghtohsdwhL88YwW3ugPekl9+\nXLwVwIp5bQaLq0K8dkIUPb8+OQ/w1+gzFsN1rrTWfHXCLFcxdPz8ffuLRknJ\ngQr7ox5dDPLQDUlwCryp+uPBmohhxf8CQSoTW78tAbDjIG/6Pg4RMUy28eV/\nwQ+6LvvzWlEhhXcTmD+uOyF6IWcRaTqF7xC1R4QdkJE82aQSzHTHqaKD4XfG\nEuLOO+4lnQwYjOSRKAWQXDYQrBlmNU0il3fIVIMcsrV1QbC6iGS9LuKtJnSJ\nggc9\r\n=yQFB\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICom5UXpwzIT1A9O9pQNs4nMnfc4cCMuYLorpxXNNSJ3AiBamqWY2FepRkI0Qk22hjA2dYo3A94YfHgzhuMZ3LnHcQ=="}]},"_npmUser":{"name":"krwhitley","email":"krwhitley@gmail.com"},"directories":{},"maintainers":[{"name":"krwhitley","email":"krwhitley@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/itty-router-extras_0.1.0_1616785071605_0.3440867549444009"},"_hasShrinkwrap":false},"0.1.1":{"name":"itty-router-extras","version":"0.1.1","description":"An assortment of delicious extras for the calorie-light itty-router.","main":"./dist/index.js","types":"./dist/index.d.ts","keywords":["router","cloudflare","workers","serverless","express","regex","routing","api","handler","params","middleware","nested","rest","crud","query","paramaters"],"scripts":{"lint":"npx eslint src","test":"yarn lint && jest --verbose --coverage src","verify":"echo 'verifying module...' && yarn build && yarn test","dev":"yarn lint && jest --verbose --watch src","coveralls":"cat ./coverage/lcov.info | node node_modules/.bin/coveralls","prerelease":"yarn verify","prebuild":"rimraf dist","build":"terser-folder src -eo dist --pattern '**/*.js,!**/*spec.js' -x .js","release":"release --tag --push"},"repository":{"type":"git","url":"git+https://github.com/kwhitley/itty-router-extras.git"},"author":{"name":"Kevin R. Whitley","email":"krwhitley@gmail.com"},"license":"MIT","bugs":{"url":"https://github.com/kwhitley/itty-router-extras/issues"},"homepage":"https://github.com/kwhitley/itty-router-extras#readme","devDependencies":{"chalk":"^4.1.0","coveralls":"^3.1.0","eslint":"^7.22.0","eslint-plugin-jest":"^24.3.2","fs-extra":"^9.1.0","gzip-size":"^6.0.0","isomorphic-fetch":"^3.0.0","itty-router":"^2.1.9","jest":"^26.6.3","rimraf":"^3.0.2","terser":"^5.6.1","terser-folder":"^2.0.0","yarn-release":"^1.10.3"},"licenseText":"MIT License\n\nCopyright (c) 2020 Kevin R. Whitley\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"itty-router-extras@0.1.1","dist":{"shasum":"7e088e9e089434e07afe9b85d5bb949c567928d0","integrity":"sha512-GAvzEUhKnGv70uZdcY9cD2tGpVJrrdnCNPikXhvD6T7rQCVnMY+wPiKG8kjVUOXq+b1rZ724XoBTaMvoTe6yew==","tarball":"https://registry.npmjs.org/itty-router-extras/-/itty-router-extras-0.1.1.tgz","fileCount":24,"unpackedSize":12055,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgXi7pCRA9TVsSAnZWagAAriYP/isXtLD6+C6j8dn/r/gJ\n1sBJm8WXO/Vs6/Dvgh9nec3VK3qaEGuyFfC82tX0/3nDZ+TffMvwhZg9hm0x\nMU7397ADBCC4whDLRota+NOD7HnlxttUV8fXUow8uIp4SBlKCrmw9Nx/1r/q\nd1MoVyy5iX4bMh8/lg4NECKJ7YauOP4VMRnXpHLlJHo0lFm7tGlC7BlkebTU\n81ZNLAfQ8mxjiuZQuoRGnGkXeHWm5BIWjX1aWMigE3gba060AZzuYOk9ucNc\ntVvVwfEmvRvCe5bHgW0hXaf33qBjUcBY+YSFoSwqukWIXehcr5egK751gAT+\n1CU9YHvYx0lJMRfb7cRMdWSNpZdVYLPCEjLsvj55xUJ2fpOFtWiGLjOImoMC\ny0/QrRFyXLzE/k48eOKaujN4wMlLImc+uyNbFUdjNYyropUDYJkMqP0YX/8k\nXjotVFaQoxALWgjb2xjY4+o1Z+USONZAYlSiQmzS/Lh4Nxc38JKcBT+OKtaV\nG5Su2ht97l3kJjYmchj7Qy1UEcx6xQgfdzTPGy6GhSRvACw5JLjFpd0O96Sb\neAVzICkj2l8rNrYs6iBeSkS9b69qestAmBNT5TfOoiMVnH0I5pkfJcy3czrR\nkfIUQaQh5MPq2wU63841Ied0/7RwWThsf2keGQG0qDM+CMynzHW5jn9MdEcF\nxsHS\r\n=Tonq\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEYhTP3bQHEYuerS+F3BMwdFPj+/bloPufOUSy2WFlB7AiBhCsIouvkC74BgZEB4isTw4l1mDL3KYl6JbSHMnb02bw=="}]},"_npmUser":{"name":"krwhitley","email":"krwhitley@gmail.com"},"directories":{},"maintainers":[{"name":"krwhitley","email":"krwhitley@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/itty-router-extras_0.1.1_1616785128997_0.9542560250083805"},"_hasShrinkwrap":false},"0.2.0":{"name":"itty-router-extras","version":"0.2.0","description":"An assortment of delicious extras for the calorie-light itty-router.","main":"./dist/index.js","types":"./dist/index.d.ts","keywords":["router","cloudflare","workers","serverless","express","regex","routing","api","handler","params","middleware","nested","rest","crud","query","paramaters"],"scripts":{"lint":"npx eslint src","test":"yarn lint && jest --verbose --coverage src","verify":"echo 'verifying module...' && yarn build && yarn test","dev":"yarn lint && jest --verbose --watch src","coveralls":"cat ./coverage/lcov.info | node node_modules/.bin/coveralls","prerelease":"yarn verify","prebuild":"rimraf dist","build":"terser-folder src -eo dist --pattern '**/*.js,!**/*spec.js' -x .js","release":"release --tag --push"},"repository":{"type":"git","url":"git+https://github.com/kwhitley/itty-router-extras.git"},"author":{"name":"Kevin R. Whitley","email":"krwhitley@gmail.com"},"license":"MIT","bugs":{"url":"https://github.com/kwhitley/itty-router-extras/issues"},"homepage":"https://github.com/kwhitley/itty-router-extras#readme","devDependencies":{"chalk":"^4.1.0","coveralls":"^3.1.0","eslint":"^7.22.0","eslint-plugin-jest":"^24.3.2","fs-extra":"^9.1.0","gzip-size":"^6.0.0","isomorphic-fetch":"^3.0.0","itty-router":"^2.2.0","jest":"^26.6.3","rimraf":"^3.0.2","terser":"^5.6.1","terser-folder":"^2.0.0","yarn-release":"^1.10.3"},"licenseText":"MIT License\n\nCopyright (c) 2020 Kevin R. Whitley\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"itty-router-extras@0.2.0","dist":{"shasum":"3b760725a291086e6467a229ff719d242c70653b","integrity":"sha512-UL80hdiT/v05OyIbTKZVUIDU6D/eciRdeqjI0u0Jn7euKhqUcYJ6aaewrb23zT5rNDpZiInvFb17TPgyMgAlyA==","tarball":"https://registry.npmjs.org/itty-router-extras/-/itty-router-extras-0.2.0.tgz","fileCount":27,"unpackedSize":13545,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgXqhVCRA9TVsSAnZWagAAaxEP/2HTFmWxQdwvH0Crls40\nqeIHR4Z7pblWk/RuPDzEILNn7lNJQHqmywr/ASoMBFjSv36hR5T0H2gtgBBn\nRWTp5wzz8EpR3QbqrwEBdid8IaqYC3FKG6fbl6c+kdcZpxh9cyHqzYHKU8su\n937uB14CH7KBykbR3QgmmGEetsHV8unTn+8J9P3Lkq/cnkfZghdpV8a8j5V1\nIPFJEyHmx16OwzA+/ubu4Cr4/ozRVhVprFM+bfyQS5X9nGcRgvUIjWVS8CfW\nIbdhP7z6ZlW4f9OIh2ADCBNVY72WLPhU7T78G4UprkFlX19KYiN7C7gOTCPl\nev/qY5AiZSS5Z63q44SD2P1ERfdEb6I2ByyTmMaGnUeL5lDRJiQw9P1lpY3V\nJ0hgujQFBtwvaJCreh7vAoT10t7Kwhi4haijBz81oX7Fs2OOP/MVv3vN00nA\n/kkObpZoEAw7P/nfUNjqOfhnaYTnuISDlnS6y4fH0RNeF+eONRaZUg7vby7l\nEFynO5odfzUMUx+6uTPDCc2z1z7NcJ74nUrnl0+S97Xm/PXd3Jl1I848sTkS\nGN/ABowPTx67vICMl6kvRwaOxB9CsNRTY7JoJexs5+IlEhMkH33+48CrrPAE\nOlWlAhutygTaLi45EEfP4eIrFEUaT1ya4JuJoePjEMh4dQZ1MzAyYqGqodWL\nPZtQ\r\n=9cc3\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCZpSqyy5rw7V0XuAjxbJeKaVo6EHeiLKG2Qcz56W6eRwIgZ3b1QyIEw++XQMgBn/7ebP8vUVjk/6PYpkYpO44mUFA="}]},"_npmUser":{"name":"krwhitley","email":"krwhitley@gmail.com"},"directories":{},"maintainers":[{"name":"krwhitley","email":"krwhitley@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/itty-router-extras_0.2.0_1616816212885_0.37673353358154915"},"_hasShrinkwrap":false},"0.2.1":{"name":"itty-router-extras","version":"0.2.1","description":"An assortment of delicious extras for the calorie-light itty-router.","main":"./dist/index.js","types":"./dist/index.d.ts","keywords":["router","cloudflare","workers","serverless","express","regex","routing","api","handler","params","middleware","nested","rest","crud","query","paramaters"],"scripts":{"lint":"npx eslint src","test":"yarn lint && jest --verbose --coverage src","verify":"echo 'verifying module...' && yarn build && yarn test","dev":"yarn lint && jest --verbose --watch src","coveralls":"cat ./coverage/lcov.info | node node_modules/.bin/coveralls","prerelease":"yarn verify","prebuild":"rimraf dist","build":"terser-folder src -eo dist --pattern '**/*.js,!**/*spec.js' -x .js","release":"release --tag --push"},"repository":{"type":"git","url":"git+https://github.com/kwhitley/itty-router-extras.git"},"author":{"name":"Kevin R. Whitley","email":"krwhitley@gmail.com"},"license":"MIT","bugs":{"url":"https://github.com/kwhitley/itty-router-extras/issues"},"homepage":"https://github.com/kwhitley/itty-router-extras#readme","devDependencies":{"chalk":"^4.1.0","coveralls":"^3.1.0","eslint":"^7.22.0","eslint-plugin-jest":"^24.3.2","fs-extra":"^9.1.0","gzip-size":"^6.0.0","isomorphic-fetch":"^3.0.0","itty-router":"^2.2.0","jest":"^26.6.3","rimraf":"^3.0.2","terser":"^5.6.1","terser-folder":"^2.0.0","yarn-release":"^1.10.3"},"licenseText":"MIT License\n\nCopyright (c) 2020 Kevin R. Whitley\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"itty-router-extras@0.2.1","dist":{"shasum":"c845ba07f9469c8ae9f88d399862276e0ef9b7b1","integrity":"sha512-hE+Ol0qc0VKWTjfouqGiCR3IuSI4LqawFli8mOPAeUAxfI72MBnUMlQQZ7LR2cc7yc/3nab00UbaECw51sHkEg==","tarball":"https://registry.npmjs.org/itty-router-extras/-/itty-router-extras-0.2.1.tgz","fileCount":27,"unpackedSize":17026,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgXrylCRA9TVsSAnZWagAA7KEP/ROIJ0/XMewDLDw08Euy\naJA5WYaxH8Wn9VRohvEL86oCzZ8X3bOiZm1c874HAawpnUslBIFRa6ZFlr6I\nbeAVeoWd5llWMkgTB+YYcS3mvVfnTm5lxeJ7szQ5vfvpqFdrYTkqYrjb+WSk\nVgp5nuDF6o1WRIyPzSVBYF1gAxI8qihObUaFe6auVtKc52MtWVw0iNuggmZZ\nZSPk+0NyDvPmG0Ko5Bb/+a7G61JOkTCBcepLxExmFYJ/E0xu8to27tq/NCQG\nKpVlKDkDu2MKQk++dWj5rffuGXZAGwvRqU2MDAJAncFIGyfZTvx6wv7rjSEi\n2g9BfKK+z18qimR4U2KLLmArIANjVtJApKW6xR71WpiHgJL7gA3neI3rKViK\no8fXbGb0SQc+Je0kLuX/ubsLfBSNgLA3lToZ0Km/avbrq5sZnz6s78Cul7dH\nTRBIOlcTIUxBHsHNoW8RYezezu2q/eHaWc5VFyc+H7e98QdD7eDbgSKQHxPN\ndEOOMVfcCLlHOo6fob8wbubv8QBiZdLRdYOgpttZRnwA4AEc5/90vvJd7DF1\nfg8Hv6oYVAe/2mPJGgpCJi/HGl5lWOZeAnk5MBCzEGS1FOeoGucZffUHgI9Q\nv+KEE887OT2fca496VAP+zLvJmfq1t8uXv4+d5f8RLBLA3aDF9H6yi2p2GLw\nQOzo\r\n=gr05\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICfdyEHWRoWA2f5RfToVjNnBlx/DP5LP6xihjGm3skrHAiA0SJRdClQnRUcHyIYIm7N8jn3q4LBG2xPuEc8pIVtbYg=="}]},"_npmUser":{"name":"krwhitley","email":"krwhitley@gmail.com"},"directories":{},"maintainers":[{"name":"krwhitley","email":"krwhitley@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/itty-router-extras_0.2.1_1616821413524_0.4903824921850599"},"_hasShrinkwrap":false},"0.2.2":{"name":"itty-router-extras","version":"0.2.2","description":"An assortment of delicious extras for the calorie-light itty-router.","main":"./dist/index.js","types":"./dist/index.d.ts","keywords":["router","cloudflare","workers","serverless","express","regex","routing","api","handler","params","middleware","nested","rest","crud","query","paramaters"],"scripts":{"lint":"npx eslint src","test":"yarn lint && jest --verbose --coverage src","verify":"echo 'verifying module...' && yarn build && yarn test","dev":"yarn lint && jest --verbose --watch src","coveralls":"cat ./coverage/lcov.info | node node_modules/.bin/coveralls","prerelease":"yarn verify","prebuild":"rimraf dist","build":"terser-folder src -eo dist --pattern '**/*.js,!**/*spec.js' -x .js","release":"release --tag --push"},"repository":{"type":"git","url":"git+https://github.com/kwhitley/itty-router-extras.git"},"author":{"name":"Kevin R. Whitley","email":"krwhitley@gmail.com"},"license":"MIT","bugs":{"url":"https://github.com/kwhitley/itty-router-extras/issues"},"homepage":"https://github.com/kwhitley/itty-router-extras#readme","devDependencies":{"chalk":"^4.1.0","coveralls":"^3.1.0","eslint":"^7.22.0","eslint-plugin-jest":"^24.3.2","fs-extra":"^9.1.0","gzip-size":"^6.0.0","isomorphic-fetch":"^3.0.0","itty-router":"^2.2.0","jest":"^26.6.3","rimraf":"^3.0.2","terser":"^5.6.1","terser-folder":"^2.0.0","yarn-release":"^1.10.3"},"licenseText":"MIT License\n\nCopyright (c) 2020 Kevin R. Whitley\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"itty-router-extras@0.2.2","dist":{"shasum":"7d5a98407d85e68db762ce3654809f5fe1f2d29c","integrity":"sha512-vLmEFNAY+kRBrDgYFisyhoERSJpImTs1fW5zFHA+iSBEUOjUr5AROVXysAGe/P0V3KyzRelXTdI0njNCezOGEQ==","tarball":"https://registry.npmjs.org/itty-router-extras/-/itty-router-extras-0.2.2.tgz","fileCount":27,"unpackedSize":16902,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgYhYGCRA9TVsSAnZWagAAOR8QAJyERGDhT7lxRdcSAqom\n2hQ5f+JYPv2++qpjHjpyTTHYONTyWHBsO/BEaleCEZg1+N/jk49P8xc6USAQ\ngoN3d4JCN1alcWkMVVegO0Q7Pr9poYsfEy261/lXJijfLUmtRpZuso0hBGKY\nwX5eDoDmO3MnDnMYbnfEWpBWXFXy/ry1TVJoqCKO9XxLXCSP/SqkcbZuMuNi\nYZPfoKeMR058XWEEMzkz/xoXun/VIrVb3UtZYwZRxotK25nZ4+C/TOw55x+R\nM0AC3GJyk0G1QzAVL7KMuhm+MMWhE93U54W9Pn7zsusYCFhyIKwUY1nu5Iah\nhXXdDKQUZYlpAyfZNQZXLVeJUmW2GETCOxbywUTqd3EjIzXfS0jgUmM3Ywvi\nog1uwtW3nGEf9IRePxylqepL/b9XOXZ9IpRnBW8p8yTE8i9Etxb8L8s7NIt4\n3xBYBhXanNH5bc2NCZIlfIiskrDgqdQ6nhMb7ROn78rWll4TBRGo6slTlOhP\n4eP1kN6XekUq+N/p/kq322WV8k3+63OJCjdowEr4OoznNzlI2V+xlW6Q/6Td\nKP2xFFmC4Lqxjzea2S+rOIrpvqMNeNS6F9JNFmZ0v9ySeN6YtvtwRwhIoW3f\nUg8noNNfsIcLSK8+D+Qjf6zoilRUhjC8btX6OKQZV0s6hyM6QSBjiaIA2vDG\nW8vS\r\n=HlLu\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDLfVFwRp+zHDtRxystb6viX1Y4ukCqwBW9kMGtLeW52AiAliKr5qqhDhlPzXWwl7wQaqSA9wxqZatrOGAG4s4D/dA=="}]},"_npmUser":{"name":"krwhitley","email":"krwhitley@gmail.com"},"directories":{},"maintainers":[{"name":"krwhitley","email":"krwhitley@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/itty-router-extras_0.2.2_1617040901943_0.4184621329518563"},"_hasShrinkwrap":false},"0.2.3":{"name":"itty-router-extras","version":"0.2.3","description":"An assortment of delicious extras for the calorie-light itty-router.","main":"./dist/index.js","types":"./dist/index.d.ts","keywords":["router","cloudflare","workers","serverless","express","regex","routing","api","handler","params","middleware","nested","rest","crud","query","paramaters"],"scripts":{"lint":"npx eslint src","test":"yarn lint && jest --verbose --coverage src","verify":"echo 'verifying module...' && yarn build && yarn test","dev":"yarn lint && jest --verbose --watch src","coveralls":"cat ./coverage/lcov.info | node node_modules/.bin/coveralls","prerelease":"yarn verify","prebuild":"rimraf dist","build":"terser-folder src -eo dist --pattern '**/*.js,!**/*spec.js' -x .js","release":"release --tag --push"},"repository":{"type":"git","url":"git+https://github.com/kwhitley/itty-router-extras.git"},"author":{"name":"Kevin R. Whitley","email":"krwhitley@gmail.com"},"license":"MIT","bugs":{"url":"https://github.com/kwhitley/itty-router-extras/issues"},"homepage":"https://github.com/kwhitley/itty-router-extras#readme","devDependencies":{"chalk":"^4.1.0","coveralls":"^3.1.0","eslint":"^7.22.0","eslint-plugin-jest":"^24.3.2","fs-extra":"^9.1.0","gzip-size":"^6.0.0","isomorphic-fetch":"^3.0.0","itty-router":"^2.2.0","jest":"^26.6.3","rimraf":"^3.0.2","terser":"^5.6.1","terser-folder":"^2.0.0","yarn-release":"^1.10.3"},"licenseText":"MIT License\n\nCopyright (c) 2020 Kevin R. Whitley\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"itty-router-extras@0.2.3","dist":{"shasum":"101b9c71762b00f95ce0707096f82abbc7313fb9","integrity":"sha512-oZIt8jBfrui6j1B2kpul+DVcbireWVQVnw0EQ3I4u6h+pqLk86qUicW4b48ZUm7KulrzZLncR86qhA2rcZhldw==","tarball":"https://registry.npmjs.org/itty-router-extras/-/itty-router-extras-0.2.3.tgz","fileCount":27,"unpackedSize":18308,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgY09+CRA9TVsSAnZWagAAs/kQAJiwLwua7991BxDxSNgJ\nTSqejVWMzj1Bu6RmGgNerDxDiT3/l8LR42OpNZQtLBvmgEa7YqyTA8xnGpD8\ndjS1jN5+mpjOrtK3R5qhAIlpQ+WfHmRjLfa6HbW0mnpI3Hp1E36j5aTs2RYF\n6ihtJUux7U1Q+tRbl0KHLNGfi+UN5Uit3zU/umn10wxW4bwFlNn52kUAl5Je\njTy9XRF/7UDSNQ29IOH88RXaZEhR4RCbjWzSkFmVbJ3Aaq5hWZKPGydg7t4F\ntp+sc+0bkzJCgU+GGh3XPcwjr6NrH5/ZUsemFzqkHxd2AjWa5RlRllGCKo6U\ntT567aLQDUgTSU3iEwWih0bGA2bALDGwHxP/RGOzAHR2VIQqP0f3tt7TfrOL\nexwNsbZCCnoH4crvjUs5sLnJarZ0xBMgcxvgwqGPv3aGfIeu9x+MtKthoSuH\nxB+ifJF3fyuIpk12E3sCkZfTjOyRYJXR4enjP9ck8ftywAHfsZKqIrKmtDQ2\n0tRvqbytNtni603j2nXQbUK9pg/jS4LYy1YxR+t4V5iavw1UequWOA4li1Ww\nWOed2FBk7IGnul1tg+qHJBMCxcA/YJ1QTJFFobzLXU6mYceRurVrh1jFJaOL\n4kvpbzSIIZ4MmuG57jDoDPhqvzMwSOVWaX48+4QOAl/UA7sX2ZsAmpNZbT13\nniwu\r\n=RKGi\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDBf+KCLs1EFypQQN6rptmBYxOvSZ3at/7I6xz2XM43qwIhAN+QDIT1PYh8NkEor5/iZm98QtLbkLX0AVRwLUZUUI7G"}]},"_npmUser":{"name":"krwhitley","email":"krwhitley@gmail.com"},"directories":{},"maintainers":[{"name":"krwhitley","email":"krwhitley@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/itty-router-extras_0.2.3_1617121149687_0.7407849713920782"},"_hasShrinkwrap":false},"0.3.0-next.0":{"name":"itty-router-extras","version":"0.3.0-next.0","description":"An assortment of delicious extras for the calorie-light itty-router.","main":"./dist/index.js","types":"./dist/index.d.ts","keywords":["router","cloudflare","workers","serverless","express","regex","routing","api","handler","params","middleware","nested","rest","crud","query","paramaters"],"scripts":{"lint":"npx eslint src","test":"yarn lint && jest --verbose --coverage src","verify":"echo 'verifying module...' && yarn build && yarn test","dev":"yarn lint && jest --verbose --watch src","coveralls":"cat ./coverage/lcov.info | node node_modules/.bin/coveralls","prerelease":"yarn verify","prebuild":"rimraf dist","build":"terser-folder src -eo dist --pattern '**/*.js,!**/*spec.js' -x .js","release":"release --tag --push"},"repository":{"type":"git","url":"git+https://github.com/kwhitley/itty-router-extras.git"},"author":{"name":"Kevin R. Whitley","email":"krwhitley@gmail.com"},"license":"MIT","bugs":{"url":"https://github.com/kwhitley/itty-router-extras/issues"},"homepage":"https://github.com/kwhitley/itty-router-extras#readme","devDependencies":{"chalk":"^4.1.0","coveralls":"^3.1.0","eslint":"^7.22.0","eslint-plugin-jest":"^24.3.2","fs-extra":"^9.1.0","gzip-size":"^6.0.0","isomorphic-fetch":"^3.0.0","itty-router":"^2.3.2","jest":"^26.6.3","rimraf":"^3.0.2","terser":"^5.6.1","terser-folder":"^2.0.0","yarn-release":"^1.10.3"},"readmeFilename":"README.md","readme":"# ![Itty Router][logo-image]\n\n[![npm package][npm-image]][npm-url]\n[![Build Status][travis-image]][travis-url]\n[![Coverage Status][coveralls-image]][coveralls-url]\n[![Open Issues][issues-image]][issues-url]\n<a href=\"https://github.com/kwhitley/itty-router-extras\" target=\"\\_parent\">\n  <img alt=\"\" src=\"https://img.shields.io/github/stars/kwhitley/itty-router-extras.svg?style=social&label=Star\" />\n</a>\n<a href=\"https://twitter.com/kevinrwhitley\" target=\"\\_parent\">\n  <img alt=\"\" src=\"https://img.shields.io/twitter/follow/kevinrwhitley.svg?style=social&label=Follow\" />\n</a>\n\nAn assortment of delicious (yet lightweight and tree-shakeable) extras for the calorie-light [itty-router](https://www.npmjs.com/package/itty-router).\n\n#### DISCLAIMER: This package is in draft-mode, so the functionality and API may change over the next week or so until we solidify and release a v1.x.  Then it should remain stable for the foreseeable future!\n\n## Installation\n\n```\nnpm install itty-router itty-router-extras\n```\n\n# Includes the following:\n\n### class\n- **[StatusError](#statuserror)** - throw these to control HTTP status codes that itty responds with.\n\n### middleware (add inline as route handlers)\n- **[withContent](#withcontent)** - safely parses and embeds content request bodies (e.g. text/json) as `request.content`\n- **[withCookies](#withcookies)** - embeds cookies into request as `request.cookies` (object)\n- **[withParams](#withparams)** - embeds route params directly into request as a convenience\n\n### response\n- **[error](#error)** - returns JSON-formatted Response with `{ error: message, status }` and the matching status code on the response.\n- **[json](#json)** - returns JSON-formatted Response with options passed to the Response (e.g. headers, status, etc)\n- **[missing](#missing)** - returns JSON-formatted 404 Response with `{ error: message, status: 404 }`\n- **[status](#status)** - returns JSON-formatted Response with `{ message, status }` and the matching status code on the response.\n- **[text](#text)** - returns plaintext-formatted Response with options passed to the Response (e.g. headers, status, etc). This is simply a normal Response, but included for code-consistency with `json()`\n\n### routers\n- **[ThrowableRouter](#throwablerouter)** - this is a convenience wrapper around [itty-router](https://www.npmjs.com/package/itty-router) that simply adds automatic exception handling, rather than requiring `try/catch` blocks within your middleware/handlers, or manually calling a `.catch(error)` on the `router.handle`.  Itty core is fantastic (biased review), but let's face it - first unhandled exception and BOOM - your Worker explodes.  This prevents that from happening!  Personally, this one is an absolute must for my projects to cut down on boilerplate code AND random CF explosions.\n\n## Example\n```js\nimport {\n  json,\n  missing,\n  error,\n  status,\n  withContent,\n  withParams,\n  ThrowableRouter,\n} from 'itty-router-extras'\n\nconst todos = [\n  { id: '13', value: 'foo' },\n  { id: '14', value: 'bar' },\n  { id: '15', value: 'baz' },\n]\n\n// create an error-safe itty router\nconst router = ThrowableRouter({ base: '/todos' })\n\n// GET collection index\nrouter.get('/', () => json(todos))\n\n// GET item\nrouter.get('/:id', withParams, ({ id }) => {\n  const todo = todos.find(t => t.id === Number(id))\n\n  return todo\n  ? json(todo)\n  : missing('That todo was not found.')\n})\n\n// POST to the collection\nrouter.post('/', withContent, ({ content }) =>\n  content\n  ? status(204) // send a 204 no-content response\n  : error(400, 'You probably need some content for that...')\n)\n\n// 404 for everything else\nrouter.all('*', () => missing('Are you sure about that?'))\n\n// attach the router \"handle\" to the event handler\naddEventListener('fetch', event =>\n  event.respondWith(router.handle(event.request))\n)\n```\n\n# API\n\n### Classes\n\n##### `StatusError(status: number, message: string): Error` <a id=\"statuserror\"></a>\nThrow these to control HTTP status codes that itty responds with.\n```js\nimport { ThrowableRouter, StatusError } from 'itty-router-extras'\n\nrouter.get('/bad', () => {\n  throw new StatusError(400, 'Bad Request')\n})\n\n// GET /bad\n400 {\n  error: 'Bad Request',\n  status: 400\n}\n```\n\n### Middleware\n\n##### `withContent: function` <a id=\"withcontent\"></a>\nSafely parses and embeds content request bodies (e.g. text/json) as `request.content`.\n```js\nimport { ThrowableRouter, StatusError } from 'itty-router-extras'\n\nconst router = ThrowableRouter()\n\nrouter\n  .post('/form', withContent, ({ content }) => {\n    // body content (json, text, or form) is parsed and ready to go, if found.\n  })\n  .post('/otherwise', async request => {\n    try {\n      const content = await request.json()\n\n      // do something with the content\n    } catch (err) {\n      throw new StatusError(400, 'Bad Request')\n    }\n  })\n```\n\n##### `withCookies: function` <a id=\"withcookies\"></a>\nEmbeds cookies into request as `request.cookies` (object).\n```js\nimport { withCookies } from 'itty-router-extras'\n\nrouter.get('/foo', withCookies, ({ cookies }) => {\n  // cookies are parsed from the header into request.cookies\n})\n```\n\n##### `withParams: function` <a id=\"withparams\"></a>\nEmbeds route params directly into request as a convenience.  *NOTE: `withParams` cannot be applied globally upstream,\nas it will have seen no route params at this stage (to spread into the request).*\n```js\nimport { withParams } from 'itty-router-extras'\n\nrouter\n  .get('/:collection/:id?', withParams, ({ collection, id }) => {\n    // route params are embedded into the request for convenience\n  })\n  .get('/otherwise/:collection/:id?', ({ params }) => {\n    // this just saves having to extract params from the request.params object\n    const { collection, id } = params\n  })\n```\n\n### Response\n\n\n##### `error(status: number, message?: string): Response` <a id=\"error\"></a>\nReturns JSON-formatted Response with `{ error: message, status }` and the matching status code on the response.\n```js\nimport { error, json } from 'itty-router-extras'\n\nrouter.get('/secrets', request =>\n  request.isLoggedIn\n  ? json({ my: 'secrets' })\n  : error(401, 'Not Authenticated')\n)\n\n// GET /secrets -->\n401 {\n  error: 'Not Authenticated',\n  status: 401\n}\n```\n\n##### `json(content: object, options: object): Response` <a id=\"json\"></a>\nReturns JSON-formatted Response with options passed to the Response (e.g. headers, status, etc).\n```js\nconst todos = [\n  { id: 1, text: 'foo' },\n  { id: 2, text: 'bar' },\n]\n\nrouter.get('/todos', () => json(todos))\n```\n\n##### `missing(message?: string): Response` <a id=\"missing\"></a>\n```js\nrouter.get('/not-found', () => missing('Oops!  We could not find that page.'))\n\n// GET /not-found -->\n404 {\n  error: 'Oops!  We could not find that page.',\n  status: 404\n}\n```\n\n##### `status(status: number, message?: string): Response` <a id=\"status\"></a>\nReturns JSON-formatted Response with `{ message, status }` and the matching status code on the response.\n```js\nrouter\n  .post('/success', withContent, ({ content }) => status(204, 'Success!'))\n  .post('/silent-success', withContent, ({ content }) => status(204))\n\n// POST /success -->\n204 {\n  message: 'Success!',\n  status: 204\n}\n\n// POST /silent-success -->\n204\n```\n\n##### `text(content: string, options?: object): Response` <a id=\"text\"></a>\nReturns plaintext-formatted Response with options passed to the Response (e.g. headers, status, etc). This is simply a normal Response, but included for code-consistency with `json()`.\n```js\nrouter.get('/plaintext', () => text('OK!'))\n\n// GET /plaintext -->\n200 OK!\n```\n\n### Routers\n\n#### `ThrowableRouter(options?: object): Proxy` <a id=\"throwablerouter\"></a>\nThis is a convenience wrapper around [itty-router](https://www.npmjs.com/package/itty-router) that simply adds automatic exception handling, rather than requiring `try/catch` blocks within your middleware/handlers, or manually calling a `.catch(error)` on the `router.handle`.\n```js\nimport { ThrowableRouter, StatusError } from 'itty-router-extras'\n\nconst router = ThrowableRouter()\n\nrouter\n  .get('/accidental', request => request.oops.this.doesnt.exist)\n  .get('/intentional', request => {\n    throw new StatusError(400, 'Bad Request')\n  })\n\n// GET /accidental\n500 {\n  error: 'Internal Error.',\n  status: 500,\n}\n\n// GET /intentional\n400 {\n  error: 'Bad Request',\n  status: 400,\n}\n```\n\n[twitter-image]:https://img.shields.io/twitter/url?style=social&url=https%3A%2F%2Fwww.npmjs.com%2Fpackage%2Fitty-router-extras\n[logo-image]:https://user-images.githubusercontent.com/865416/112549341-a4377300-8d8b-11eb-8977-574967dede99.png\n[gzip-image]:https://img.shields.io/bundlephobia/minzip/itty-router-extras\n[gzip-url]:https://bundlephobia.com/result?p=itty-router-extras\n[issues-image]:https://img.shields.io/github/issues/kwhitley/itty-router-extras\n[issues-url]:https://github.com/kwhitley/itty-router-extras/issues\n[npm-image]:https://img.shields.io/npm/v/itty-router-extras.svg\n[npm-url]:http://npmjs.org/package/itty-router-extras\n[travis-image]:https://travis-ci.org/kwhitley/itty-router-extras.svg?branch=v0.x\n[travis-url]:https://travis-ci.org/kwhitley/itty-router-extras\n[david-image]:https://david-dm.org/kwhitley/itty-router-extras/status.svg\n[david-url]:https://david-dm.org/kwhitley/itty-router-extras\n[coveralls-image]:https://coveralls.io/repos/github/kwhitley/itty-router-extras/badge.svg?branch=v0.x\n[coveralls-url]:https://coveralls.io/github/kwhitley/itty-router-extras?branch=v0.x\n\n## Contributors\nThese folks are the real heroes, making open source the powerhouse that it is!  Help out and get your name added to this list! <3\n\n#### Core, Concepts, and Codebase\n- [@mvasigh](https://github.com/mvasigh) - for constantly discussing these ridiculously-in-the-weeds topics with me.  And then for writing the TS interfaces (or simply re-writing in TS), right Mehdi??\n","licenseText":"MIT License\n\nCopyright (c) 2020 Kevin R. Whitley\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"itty-router-extras@0.3.0-next.0","dist":{"shasum":"f1748107b8da557080f6338b3fa6547623de8454","integrity":"sha512-p2A+MKklsEKY3t/Skcx2YcnGnvdUe34EnDJHaakVn/M5tzn8ImpsNRI4xirW8QZ3KrOl39ShD5/TMN9SOLDDBg==","tarball":"https://registry.npmjs.org/itty-router-extras/-/itty-router-extras-0.3.0-next.0.tgz","fileCount":30,"unpackedSize":16759,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgafN/CRA9TVsSAnZWagAAp4wP/3nx+lzltAlnBZa1/tRS\njQSA43dGaMDPQMib8KagPms+bFhZlAadYgpZT8UYBPb4NWoJ3t9CYYBiAlSw\nJ9xpimt3nNE8WgWtyXNrqLOKGmnq86q+MioLl0G2As3IPsXQ9lidFOx5xL1k\nLBTOOCLIDaUTnT+DoiWhynLyub3H8rkZShyz0vOixAimMzM86N40qErltj0N\n9nRTC2z3lyXqFsEPMEMZSjHeVa78UPb9gKyCysrpqJt58/iKaay/bWxCf5+5\n5YYhHUs4g+yg35Xs1pwAJ9f0fGBMW/s6/WC7DC65TZQDVY3d/k5fycArpjlE\nUGa4vK4UqBFhHsn9Sf6U9+as87GQ/1va1GO58s07vczMY23W9qEp7C5GyHIC\nT1c81VeGiuUhuzBfUUcDxT1YGdGGzGJ7+aYDbwTHrFkR22T1KJO/dm2zEDN5\nnWFr0qURsuYKhV+UJUrggCXBc+JulWCgb+SYaxy/15QD7T9lPzuSZcd/ABkS\nnDRXc9rDqFi3zUfSjSihpe7bQtModUwidc+XJ9h3OpfkZX2PSjH5Ir1jIScW\n8uSuuh+tSUQcggQVUyTC2uMt2r6UvJtKMa4EvQE2RJcA5m4kFZoFZwOqhsnF\nJzRyuP+Zob+GOmXUUji8jww3ktUuIP1AfTChsbAbUxM50UldM677oOuKwejW\nBBEQ\r\n=Nogf\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDogiTJu4xylwsfC/hOI+SBBe2/2SXDh5rfV+qnUoyWqQIhANKSjsrOnRwuaEAgsyga/kZa/bLW1SETNlcm7IzJ9+2s"}]},"_npmUser":{"name":"krwhitley","email":"krwhitley@gmail.com"},"directories":{},"maintainers":[{"name":"mvasigh","email":"mehdivasigh@gmail.com"},{"name":"krwhitley","email":"krwhitley@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/itty-router-extras_0.3.0-next.0_1617556350747_0.5743356860978892"},"_hasShrinkwrap":false},"0.3.0-next.1":{"name":"itty-router-extras","version":"0.3.0-next.1","description":"An assortment of delicious extras for the calorie-light itty-router.","main":".index.js","keywords":["router","cloudflare","workers","serverless","regex","routing","api","handler","params","middleware","nested","helpers","utils","cookies","content","cors"],"scripts":{"lint":"npx eslint src","test":"yarn lint && jest --verbose --coverage src","verify":"echo 'verifying module...' && yarn build && yarn test","dev":"yarn lint && jest --verbose --watch src","coveralls":"cat ./coverage/lcov.info | node node_modules/.bin/coveralls","prerelease":"yarn verify","prebuild":"rimraf dist","build":"terser-folder src -eo dist --pattern '**/*.js,!**/*spec.js' -x .js","release":"release --tag --push"},"repository":{"type":"git","url":"git+https://github.com/kwhitley/itty-router-extras.git"},"author":{"name":"Kevin R. Whitley","email":"krwhitley@gmail.com"},"license":"MIT","bugs":{"url":"https://github.com/kwhitley/itty-router-extras/issues"},"homepage":"https://github.com/kwhitley/itty-router-extras#readme","devDependencies":{"chalk":"^4.1.0","coveralls":"^3.1.0","eslint":"^7.22.0","eslint-plugin-jest":"^24.3.2","fs-extra":"^9.1.0","gzip-size":"^6.0.0","isomorphic-fetch":"^3.0.0","itty-router":"^2.3.2","jest":"^26.6.3","rimraf":"^3.0.2","terser":"^5.6.1","terser-folder":"^2.0.0","yarn-release":"^1.10.3"},"readmeFilename":"README.md","readme":"# ![Itty Router][logo-image]\n\n[![npm package][npm-image]][npm-url]\n[![Build Status][travis-image]][travis-url]\n[![Coverage Status][coveralls-image]][coveralls-url]\n[![Open Issues][issues-image]][issues-url]\n<a href=\"https://github.com/kwhitley/itty-router-extras\" target=\"\\_parent\">\n  <img alt=\"\" src=\"https://img.shields.io/github/stars/kwhitley/itty-router-extras.svg?style=social&label=Star\" />\n</a>\n<a href=\"https://twitter.com/kevinrwhitley\" target=\"\\_parent\">\n  <img alt=\"\" src=\"https://img.shields.io/twitter/follow/kevinrwhitley.svg?style=social&label=Follow\" />\n</a>\n\nAn assortment of delicious (yet lightweight and tree-shakeable) extras for the calorie-light [itty-router](https://www.npmjs.com/package/itty-router).\n\n#### DISCLAIMER: This package is in draft-mode, so the functionality and API may change over the next week or so until we solidify and release a v1.x.  Then it should remain stable for the foreseeable future!\n\n## Installation\n\n```\nnpm install itty-router itty-router-extras\n```\n\n# Includes the following:\n\n### class\n- **[StatusError](#statuserror)** - throw these to control HTTP status codes that itty responds with.\n\n### middleware (add inline as route handlers)\n- **[withContent](#withcontent)** - safely parses and embeds content request bodies (e.g. text/json) as `request.content`\n- **[withCookies](#withcookies)** - embeds cookies into request as `request.cookies` (object)\n- **[withParams](#withparams)** - embeds route params directly into request as a convenience\n\n### response\n- **[error](#error)** - returns JSON-formatted Response with `{ error: message, status }` and the matching status code on the response.\n- **[json](#json)** - returns JSON-formatted Response with options passed to the Response (e.g. headers, status, etc)\n- **[missing](#missing)** - returns JSON-formatted 404 Response with `{ error: message, status: 404 }`\n- **[status](#status)** - returns JSON-formatted Response with `{ message, status }` and the matching status code on the response.\n- **[text](#text)** - returns plaintext-formatted Response with options passed to the Response (e.g. headers, status, etc). This is simply a normal Response, but included for code-consistency with `json()`\n\n### routers\n- **[ThrowableRouter](#throwablerouter)** - this is a convenience wrapper around [itty-router](https://www.npmjs.com/package/itty-router) that simply adds automatic exception handling, rather than requiring `try/catch` blocks within your middleware/handlers, or manually calling a `.catch(error)` on the `router.handle`.  Itty core is fantastic (biased review), but let's face it - first unhandled exception and BOOM - your Worker explodes.  This prevents that from happening!  Personally, this one is an absolute must for my projects to cut down on boilerplate code AND random CF explosions.\n\n## Example\n```js\nimport {\n  json,\n  missing,\n  error,\n  status,\n  withContent,\n  withParams,\n  ThrowableRouter,\n} from 'itty-router-extras'\n\nconst todos = [\n  { id: '13', value: 'foo' },\n  { id: '14', value: 'bar' },\n  { id: '15', value: 'baz' },\n]\n\n// create an error-safe itty router\nconst router = ThrowableRouter({ base: '/todos' })\n\n// GET collection index\nrouter.get('/', () => json(todos))\n\n// GET item\nrouter.get('/:id', withParams, ({ id }) => {\n  const todo = todos.find(t => t.id === Number(id))\n\n  return todo\n  ? json(todo)\n  : missing('That todo was not found.')\n})\n\n// POST to the collection\nrouter.post('/', withContent, ({ content }) =>\n  content\n  ? status(204) // send a 204 no-content response\n  : error(400, 'You probably need some content for that...')\n)\n\n// 404 for everything else\nrouter.all('*', () => missing('Are you sure about that?'))\n\n// attach the router \"handle\" to the event handler\naddEventListener('fetch', event =>\n  event.respondWith(router.handle(event.request))\n)\n```\n\n# API\n\n### Classes\n\n##### `StatusError(status: number, message: string): Error` <a id=\"statuserror\"></a>\nThrow these to control HTTP status codes that itty responds with.\n```js\nimport { ThrowableRouter, StatusError } from 'itty-router-extras'\n\nrouter.get('/bad', () => {\n  throw new StatusError(400, 'Bad Request')\n})\n\n// GET /bad\n400 {\n  error: 'Bad Request',\n  status: 400\n}\n```\n\n### Middleware\n\n##### `withContent: function` <a id=\"withcontent\"></a>\nSafely parses and embeds content request bodies (e.g. text/json) as `request.content`.\n```js\nimport { ThrowableRouter, StatusError } from 'itty-router-extras'\n\nconst router = ThrowableRouter()\n\nrouter\n  .post('/form', withContent, ({ content }) => {\n    // body content (json, text, or form) is parsed and ready to go, if found.\n  })\n  .post('/otherwise', async request => {\n    try {\n      const content = await request.json()\n\n      // do something with the content\n    } catch (err) {\n      throw new StatusError(400, 'Bad Request')\n    }\n  })\n```\n\n##### `withCookies: function` <a id=\"withcookies\"></a>\nEmbeds cookies into request as `request.cookies` (object).\n```js\nimport { withCookies } from 'itty-router-extras'\n\nrouter.get('/foo', withCookies, ({ cookies }) => {\n  // cookies are parsed from the header into request.cookies\n})\n```\n\n##### `withParams: function` <a id=\"withparams\"></a>\nEmbeds route params directly into request as a convenience.  *NOTE: `withParams` cannot be applied globally upstream,\nas it will have seen no route params at this stage (to spread into the request).*\n```js\nimport { withParams } from 'itty-router-extras'\n\nrouter\n  .get('/:collection/:id?', withParams, ({ collection, id }) => {\n    // route params are embedded into the request for convenience\n  })\n  .get('/otherwise/:collection/:id?', ({ params }) => {\n    // this just saves having to extract params from the request.params object\n    const { collection, id } = params\n  })\n```\n\n### Response\n\n\n##### `error(status: number, message?: string): Response` <a id=\"error\"></a>\n##### `error(status: number, payload?: object): Response`\nReturns JSON-formatted Response with `{ error: message, status }` (or custom payload) and the matching status code on the response.\n```js\nimport { error, json } from 'itty-router-extras'\n\nrouter.get('/secrets', request =>\n  request.isLoggedIn\n  ? json({ my: 'secrets' })\n  : error(401, 'Not Authenticated')\n)\n\n// GET /secrets -->\n401 {\n  error: 'Not Authenticated',\n  status: 401\n}\n\n// custom payloads...\nerror(500, { custom: 'payload' }) -->\n500 {\n  custom: 'payload'\n}\n```\n\n##### `json(content: object, options: object): Response` <a id=\"json\"></a>\nReturns JSON-formatted Response with options passed to the Response (e.g. headers, status, etc).\n```js\nconst todos = [\n  { id: 1, text: 'foo' },\n  { id: 2, text: 'bar' },\n]\n\nrouter.get('/todos', () => json(todos))\n```\n\n##### `missing(message?: string): Response` <a id=\"missing\"></a>\n##### `missing(payload?: object): Response`\n```js\nrouter\n  .get('/not-found', () => missing('Oops!  We could not find that page.'))\n  .get('/custom-not-found', () => missing({ message: 'Are you sure about that?' }))\n\n// GET /not-found -->\n404 {\n  error: 'Oops!  We could not find that page.',\n  status: 404\n}\n\n// GET /custom-not-found -->\n404 {\n  message: 'Are you sure about that?'\n}\n```\n\n##### `status(status: number, message?: string): Response` <a id=\"status\"></a>\n##### `status(status: number, payload?: object): Response`\nReturns JSON-formatted Response with `{ message, status }` and the matching status code on the response.\n```js\nrouter\n  .post('/success', withContent, ({ content }) => status(201, 'Created!'))\n  .post('/silent-success', withContent, ({ content }) => status(204))\n  .post('/custom-success', withContent, ({ content }) => status(201, { created: 'Todo#1' }))\n\n// POST /success -->\n201 {\n  message: 'Created!',\n  status: 201\n}\n\n// POST /silent-success -->\n204\n\n// POST /custom-success -->\n204 {\n  created: 'Todo#1'\n}\n```\n\n##### `text(content: string, options?: object): Response` <a id=\"text\"></a>\nReturns plaintext-formatted Response with options passed to the Response (e.g. headers, status, etc). This is simply a normal Response, but included for code-consistency with `json()`.\n```js\nrouter.get('/plaintext', () => text('OK!'))\n\n// GET /plaintext -->\n200 OK!\n```\n\n### Routers\n\n#### `ThrowableRouter(options?: object): Proxy` <a id=\"throwablerouter\"></a>\nThis is a convenience wrapper around [itty-router](https://www.npmjs.com/package/itty-router) that simply adds automatic exception handling (with automatic response), rather than requiring `try/catch` blocks within your middleware/handlers, or manually calling a `.catch(error)` on the `router.handle`. **For more elaborate error handling, such as logging errors before a response, [use the core Router from itty-router (see example)](#advanced-error-handling).**\n```js\nimport { ThrowableRouter, StatusError } from 'itty-router-extras'\n\nconst router = ThrowableRouter()\n\nrouter\n  .get('/accidental', request => request.oops.this.doesnt.exist)\n  .get('/intentional', request => {\n    throw new StatusError(400, 'Bad Request')\n  })\n\nexports default {\n  fetch: router.handle\n}\n\n// GET /accidental\n500 {\n  error: 'Internal Error.',\n  status: 500,\n}\n\n// GET /intentional\n400 {\n  error: 'Bad Request',\n  status: 400,\n}\n```\n\nAdding stack traces via `{ stack: true }`:\n```js\nimport { ThrowableRouter } from 'itty-router-extras'\n\nconst router = ThrowableRouter({ stack: true })\n\nrouter\n  .get('/accidental', request => request.oops.this.doesnt.exist)\n\nexports default {\n  fetch: router.handle\n}\n\n// GET /accidental\n500 {\n  error: 'Cannot find \"this\" of undefined...',\n  stack: 'Cannot find \"this\" of undefined blah blah blah on line 6...',\n  status: 500,\n}\n```\n\n### Advanced Error Handling\nOnce you need to control more elaborate error handling, simply ditch `ThrowableRouter` (because it will catch and respond before you can), and add your own `.catch(err)` to the core itty `Router` as follows:\n```js\nimport { Router } from 'itty-router'\nimport { error } from 'itty-router-extras'\nimport { logTheErrorSomewhere } from 'some-other-repo'\n\nconst router = Router()\n\nrouter\n  .get('/accidental', request => request.oops.this.doesnt.exist)\n\nexports default {\n  fetch: (request, ...args) => router\n                                 .handle(request, ...args)\n                                 .catch(async err => {\n                                   // do something fancy with the error\n                                   await logTheErrorSomewhere({\n                                     url: request.url,\n                                     error: err.message,\n                                   })\n\n                                   // then return an error response to the user/request\n                                   return error(500, 'Internal Serverless Error')\n                                 })\n}\n\n// GET /accidental\n500 {\n  error: 'Internal Serverless Error',\n  status: 500,\n}\n```\n\n[twitter-image]:https://img.shields.io/twitter/url?style=social&url=https%3A%2F%2Fwww.npmjs.com%2Fpackage%2Fitty-router-extras\n[logo-image]:https://user-images.githubusercontent.com/865416/112549341-a4377300-8d8b-11eb-8977-574967dede99.png\n[gzip-image]:https://img.shields.io/bundlephobia/minzip/itty-router-extras\n[gzip-url]:https://bundlephobia.com/result?p=itty-router-extras\n[issues-image]:https://img.shields.io/github/issues/kwhitley/itty-router-extras\n[issues-url]:https://github.com/kwhitley/itty-router-extras/issues\n[npm-image]:https://img.shields.io/npm/v/itty-router-extras.svg\n[npm-url]:http://npmjs.org/package/itty-router-extras\n[travis-image]:https://travis-ci.org/kwhitley/itty-router-extras.svg?branch=v0.x\n[travis-url]:https://travis-ci.org/kwhitley/itty-router-extras\n[david-image]:https://david-dm.org/kwhitley/itty-router-extras/status.svg\n[david-url]:https://david-dm.org/kwhitley/itty-router-extras\n[coveralls-image]:https://coveralls.io/repos/github/kwhitley/itty-router-extras/badge.svg?branch=v0.x\n[coveralls-url]:https://coveralls.io/github/kwhitley/itty-router-extras?branch=v0.x\n\n## Contributors\nThese folks are the real heroes, making open source the powerhouse that it is!  Help out and get your name added to this list! <3\n\n#### Core, Concepts, and Codebase\n- [@mvasigh](https://github.com/mvasigh) - for constantly discussing these ridiculously-in-the-weeds topics with me.  And then for writing the TS interfaces (or simply re-writing in TS), right Mehdi??\n","licenseText":"MIT License\n\nCopyright (c) 2020 Kevin R. Whitley\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"itty-router-extras@0.3.0-next.1","dist":{"shasum":"2c4f97173f0c8d007d86609cd63cd2842abaa71a","integrity":"sha512-JntgvcLz56HI0e7jjMTD404yH+ZdQmTp/F9IvkxFZVdr93CPxmLvr5c32M6EEGP8fjGL4jimw5lem4+MUjkAzA==","tarball":"https://registry.npmjs.org/itty-router-extras/-/itty-router-extras-0.3.0-next.1.tgz","fileCount":51,"unpackedSize":67431,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgc+RMCRA9TVsSAnZWagAAPzEP/j40Ra1xbUcs2Xx5MEgE\nF445IxXSYrEof+QDI1OFW1NLFTIP9yLrf1TaKjjt0CKc+tVvMUahWAbJoAYz\nJTnwA953yk3mW2rExpeX8WnYfCXtqxdiWWvlk/sgnp/Nd4/kGRAiG5AyC8HT\nJWbZlc4Kij/KwC6yULXGOLGnUhQD/MzMVSEGH8HlFKUxpLbQPvraer35iUtu\nowKRd+BaxXYPKRCfazcvA+E7brUAzylPN61eMtRafXN0pcPcTe5LFHVtb4uI\nGvyWjw+G9G1zSqSUXdl1RqlduaYCiTPfWtW9MWcbOS5QNAT6/OUtqzc+6A9k\n0o2EroZgqWNJwfWPHZCkEq1HotQnAkntZJ8d7w5KAiQz8dQ7jHjAXcAPPYFj\nw+/9DRyz4YIh4NENJWlKycmyE9Q/KZlItcNBZUUB93gYo81FOxYZ5Tb9TkGE\nm8eVv4RlD3NPAQhhfTvlDb3vRoMiXUUxJTS8Cv58gmJRX0i0YbB5bNIXFawb\nMH4SVDqVbV3lrkDsxSDAm+hU17hAd4gGuFKT+INZ5YSD4YbywjaUSMWeSp1x\nJ408mqzj1YFrce8pWpGlW1oXqH447WlrpN0hjLpktOOVtmdCfg8kykiLk0GO\nixDw635f4qfrkXfdq81O+RYWbRpKKxZm8ylALuV4+DJ9K+B2Fsykm4iqKJ5M\n74/J\r\n=VRIx\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDyHohflr/zzPDafZJ/Hv/kGA78D2m7fv4kyg8gBEkONAiEA+mJtqLV1sJFr+pvIuUwo2LPBMcDsM8Te7LgmUiAlqdw="}]},"_npmUser":{"name":"krwhitley","email":"krwhitley@gmail.com"},"directories":{},"maintainers":[{"name":"mvasigh","email":"mehdivasigh@gmail.com"},{"name":"krwhitley","email":"krwhitley@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/itty-router-extras_0.3.0-next.1_1618207820496_0.8904701189183648"},"_hasShrinkwrap":false},"0.3.0-next.2":{"name":"itty-router-extras","version":"0.3.0-next.2","description":"An assortment of delicious extras for the calorie-light itty-router.","main":"./index.js","keywords":["router","cloudflare","workers","serverless","regex","routing","api","handler","params","middleware","nested","helpers","utils","cookies","content","cors"],"scripts":{"lint":"npx eslint src","test":"yarn lint && jest --verbose --coverage src","verify":"echo 'verifying module...' && yarn build && yarn test","dev":"yarn lint && jest --verbose --watch src","coveralls":"cat ./coverage/lcov.info | node node_modules/.bin/coveralls","prerelease":"yarn verify","prebuild":"rimraf dist","build":"terser-folder src -eo dist --pattern '**/*.js,!**/*spec.js' -x .js","release":"release --tag --push --src=dist"},"repository":{"type":"git","url":"git+https://github.com/kwhitley/itty-router-extras.git"},"author":{"name":"Kevin R. Whitley","email":"krwhitley@gmail.com"},"license":"MIT","bugs":{"url":"https://github.com/kwhitley/itty-router-extras/issues"},"homepage":"https://github.com/kwhitley/itty-router-extras#readme","devDependencies":{"chalk":"^4.1.0","coveralls":"^3.1.0","eslint":"^7.22.0","eslint-plugin-jest":"^24.3.2","fs-extra":"^9.1.0","gzip-size":"^6.0.0","isomorphic-fetch":"^3.0.0","itty-router":"^2.3.2","jest":"^26.6.3","rimraf":"^3.0.2","terser":"^5.6.1","terser-folder":"^2.0.0","yarn-release":"^1.10.3"},"readmeFilename":"README.md","readme":"# ![Itty Router][logo-image]\n\n[![npm package][npm-image]][npm-url]\n[![Build Status][travis-image]][travis-url]\n[![Coverage Status][coveralls-image]][coveralls-url]\n[![Open Issues][issues-image]][issues-url]\n<a href=\"https://github.com/kwhitley/itty-router-extras\" target=\"\\_parent\">\n  <img alt=\"\" src=\"https://img.shields.io/github/stars/kwhitley/itty-router-extras.svg?style=social&label=Star\" />\n</a>\n<a href=\"https://twitter.com/kevinrwhitley\" target=\"\\_parent\">\n  <img alt=\"\" src=\"https://img.shields.io/twitter/follow/kevinrwhitley.svg?style=social&label=Follow\" />\n</a>\n\nAn assortment of delicious (yet lightweight and tree-shakeable) extras for the calorie-light [itty-router](https://www.npmjs.com/package/itty-router).\n\n#### DISCLAIMER: This package is in draft-mode, so the functionality and API may change over the next week or so until we solidify and release a v1.x.  Then it should remain stable for the foreseeable future!\n\n## Installation\n\n```\nnpm install itty-router itty-router-extras\n```\n\n# Includes the following:\n\n### class\n- **[StatusError](#statuserror)** - throw these to control HTTP status codes that itty responds with.\n\n### middleware (add inline as route handlers)\n- **[withContent](#withcontent)** - safely parses and embeds content request bodies (e.g. text/json) as `request.content`\n- **[withCookies](#withcookies)** - embeds cookies into request as `request.cookies` (object)\n- **[withParams](#withparams)** - embeds route params directly into request as a convenience\n\n### response\n- **[error](#error)** - returns JSON-formatted Response with `{ error: message, status }` and the matching status code on the response.\n- **[json](#json)** - returns JSON-formatted Response with options passed to the Response (e.g. headers, status, etc)\n- **[missing](#missing)** - returns JSON-formatted 404 Response with `{ error: message, status: 404 }`\n- **[status](#status)** - returns JSON-formatted Response with `{ message, status }` and the matching status code on the response.\n- **[text](#text)** - returns plaintext-formatted Response with options passed to the Response (e.g. headers, status, etc). This is simply a normal Response, but included for code-consistency with `json()`\n\n### routers\n- **[ThrowableRouter](#throwablerouter)** - this is a convenience wrapper around [itty-router](https://www.npmjs.com/package/itty-router) that simply adds automatic exception handling, rather than requiring `try/catch` blocks within your middleware/handlers, or manually calling a `.catch(error)` on the `router.handle`.  Itty core is fantastic (biased review), but let's face it - first unhandled exception and BOOM - your Worker explodes.  This prevents that from happening!  Personally, this one is an absolute must for my projects to cut down on boilerplate code AND random CF explosions.\n\n## Example\n```js\nimport {\n  json,\n  missing,\n  error,\n  status,\n  withContent,\n  withParams,\n  ThrowableRouter,\n} from 'itty-router-extras'\n\nconst todos = [\n  { id: '13', value: 'foo' },\n  { id: '14', value: 'bar' },\n  { id: '15', value: 'baz' },\n]\n\n// create an error-safe itty router\nconst router = ThrowableRouter({ base: '/todos' })\n\n// GET collection index\nrouter.get('/', () => json(todos))\n\n// GET item\nrouter.get('/:id', withParams, ({ id }) => {\n  const todo = todos.find(t => t.id === Number(id))\n\n  return todo\n  ? json(todo)\n  : missing('That todo was not found.')\n})\n\n// POST to the collection\nrouter.post('/', withContent, ({ content }) =>\n  content\n  ? status(204) // send a 204 no-content response\n  : error(400, 'You probably need some content for that...')\n)\n\n// 404 for everything else\nrouter.all('*', () => missing('Are you sure about that?'))\n\n// attach the router \"handle\" to the event handler\naddEventListener('fetch', event =>\n  event.respondWith(router.handle(event.request))\n)\n```\n\n# API\n\n### Classes\n\n##### `StatusError(status: number, message: string): Error` <a id=\"statuserror\"></a>\nThrow these to control HTTP status codes that itty responds with.\n```js\nimport { ThrowableRouter, StatusError } from 'itty-router-extras'\n\nrouter.get('/bad', () => {\n  throw new StatusError(400, 'Bad Request')\n})\n\n// GET /bad\n400 {\n  error: 'Bad Request',\n  status: 400\n}\n```\n\n### Middleware\n\n##### `withContent: function` <a id=\"withcontent\"></a>\nSafely parses and embeds content request bodies (e.g. text/json) as `request.content`.\n```js\nimport { ThrowableRouter, StatusError } from 'itty-router-extras'\n\nconst router = ThrowableRouter()\n\nrouter\n  .post('/form', withContent, ({ content }) => {\n    // body content (json, text, or form) is parsed and ready to go, if found.\n  })\n  .post('/otherwise', async request => {\n    try {\n      const content = await request.json()\n\n      // do something with the content\n    } catch (err) {\n      throw new StatusError(400, 'Bad Request')\n    }\n  })\n```\n\n##### `withCookies: function` <a id=\"withcookies\"></a>\nEmbeds cookies into request as `request.cookies` (object).\n```js\nimport { withCookies } from 'itty-router-extras'\n\nrouter.get('/foo', withCookies, ({ cookies }) => {\n  // cookies are parsed from the header into request.cookies\n})\n```\n\n##### `withParams: function` <a id=\"withparams\"></a>\nEmbeds route params directly into request as a convenience.  *NOTE: `withParams` cannot be applied globally upstream,\nas it will have seen no route params at this stage (to spread into the request).*\n```js\nimport { withParams } from 'itty-router-extras'\n\nrouter\n  .get('/:collection/:id?', withParams, ({ collection, id }) => {\n    // route params are embedded into the request for convenience\n  })\n  .get('/otherwise/:collection/:id?', ({ params }) => {\n    // this just saves having to extract params from the request.params object\n    const { collection, id } = params\n  })\n```\n\n### Response\n\n\n##### `error(status: number, message?: string): Response` <a id=\"error\"></a>\n##### `error(status: number, payload?: object): Response`\nReturns JSON-formatted Response with `{ error: message, status }` (or custom payload) and the matching status code on the response.\n```js\nimport { error, json } from 'itty-router-extras'\n\nrouter.get('/secrets', request =>\n  request.isLoggedIn\n  ? json({ my: 'secrets' })\n  : error(401, 'Not Authenticated')\n)\n\n// GET /secrets -->\n401 {\n  error: 'Not Authenticated',\n  status: 401\n}\n\n// custom payloads...\nerror(500, { custom: 'payload' }) -->\n500 {\n  custom: 'payload'\n}\n```\n\n##### `json(content: object, options: object): Response` <a id=\"json\"></a>\nReturns JSON-formatted Response with options passed to the Response (e.g. headers, status, etc).\n```js\nconst todos = [\n  { id: 1, text: 'foo' },\n  { id: 2, text: 'bar' },\n]\n\nrouter.get('/todos', () => json(todos))\n```\n\n##### `missing(message?: string): Response` <a id=\"missing\"></a>\n##### `missing(payload?: object): Response`\n```js\nrouter\n  .get('/not-found', () => missing('Oops!  We could not find that page.'))\n  .get('/custom-not-found', () => missing({ message: 'Are you sure about that?' }))\n\n// GET /not-found -->\n404 {\n  error: 'Oops!  We could not find that page.',\n  status: 404\n}\n\n// GET /custom-not-found -->\n404 {\n  message: 'Are you sure about that?'\n}\n```\n\n##### `status(status: number, message?: string): Response` <a id=\"status\"></a>\n##### `status(status: number, payload?: object): Response`\nReturns JSON-formatted Response with `{ message, status }` and the matching status code on the response.\n```js\nrouter\n  .post('/success', withContent, ({ content }) => status(201, 'Created!'))\n  .post('/silent-success', withContent, ({ content }) => status(204))\n  .post('/custom-success', withContent, ({ content }) => status(201, { created: 'Todo#1' }))\n\n// POST /success -->\n201 {\n  message: 'Created!',\n  status: 201\n}\n\n// POST /silent-success -->\n204\n\n// POST /custom-success -->\n204 {\n  created: 'Todo#1'\n}\n```\n\n##### `text(content: string, options?: object): Response` <a id=\"text\"></a>\nReturns plaintext-formatted Response with options passed to the Response (e.g. headers, status, etc). This is simply a normal Response, but included for code-consistency with `json()`.\n```js\nrouter.get('/plaintext', () => text('OK!'))\n\n// GET /plaintext -->\n200 OK!\n```\n\n### Routers\n\n#### `ThrowableRouter(options?: object): Proxy` <a id=\"throwablerouter\"></a>\nThis is a convenience wrapper around [itty-router](https://www.npmjs.com/package/itty-router) that simply adds automatic exception handling (with automatic response), rather than requiring `try/catch` blocks within your middleware/handlers, or manually calling a `.catch(error)` on the `router.handle`. **For more elaborate error handling, such as logging errors before a response, [use the core Router from itty-router (see example)](#advanced-error-handling).**\n```js\nimport { ThrowableRouter, StatusError } from 'itty-router-extras'\n\nconst router = ThrowableRouter()\n\nrouter\n  .get('/accidental', request => request.oops.this.doesnt.exist)\n  .get('/intentional', request => {\n    throw new StatusError(400, 'Bad Request')\n  })\n\nexports default {\n  fetch: router.handle\n}\n\n// GET /accidental\n500 {\n  error: 'Internal Error.',\n  status: 500,\n}\n\n// GET /intentional\n400 {\n  error: 'Bad Request',\n  status: 400,\n}\n```\n\nAdding stack traces via `{ stack: true }`:\n```js\nimport { ThrowableRouter } from 'itty-router-extras'\n\nconst router = ThrowableRouter({ stack: true })\n\nrouter\n  .get('/accidental', request => request.oops.this.doesnt.exist)\n\nexports default {\n  fetch: router.handle\n}\n\n// GET /accidental\n500 {\n  error: 'Cannot find \"this\" of undefined...',\n  stack: 'Cannot find \"this\" of undefined blah blah blah on line 6...',\n  status: 500,\n}\n```\n\n### Advanced Error Handling\nOnce you need to control more elaborate error handling, simply ditch `ThrowableRouter` (because it will catch and respond before you can), and add your own `.catch(err)` to the core itty `Router` as follows:\n```js\nimport { Router } from 'itty-router'\nimport { error } from 'itty-router-extras'\nimport { logTheErrorSomewhere } from 'some-other-repo'\n\nconst router = Router()\n\nrouter\n  .get('/accidental', request => request.oops.this.doesnt.exist)\n\nexports default {\n  fetch: (request, ...args) => router\n                                 .handle(request, ...args)\n                                 .catch(async err => {\n                                   // do something fancy with the error\n                                   await logTheErrorSomewhere({\n                                     url: request.url,\n                                     error: err.message,\n                                   })\n\n                                   // then return an error response to the user/request\n                                   return error(500, 'Internal Serverless Error')\n                                 })\n}\n\n// GET /accidental\n500 {\n  error: 'Internal Serverless Error',\n  status: 500,\n}\n```\n\n[twitter-image]:https://img.shields.io/twitter/url?style=social&url=https%3A%2F%2Fwww.npmjs.com%2Fpackage%2Fitty-router-extras\n[logo-image]:https://user-images.githubusercontent.com/865416/112549341-a4377300-8d8b-11eb-8977-574967dede99.png\n[gzip-image]:https://img.shields.io/bundlephobia/minzip/itty-router-extras\n[gzip-url]:https://bundlephobia.com/result?p=itty-router-extras\n[issues-image]:https://img.shields.io/github/issues/kwhitley/itty-router-extras\n[issues-url]:https://github.com/kwhitley/itty-router-extras/issues\n[npm-image]:https://img.shields.io/npm/v/itty-router-extras.svg\n[npm-url]:http://npmjs.org/package/itty-router-extras\n[travis-image]:https://travis-ci.org/kwhitley/itty-router-extras.svg?branch=v0.x\n[travis-url]:https://travis-ci.org/kwhitley/itty-router-extras\n[david-image]:https://david-dm.org/kwhitley/itty-router-extras/status.svg\n[david-url]:https://david-dm.org/kwhitley/itty-router-extras\n[coveralls-image]:https://coveralls.io/repos/github/kwhitley/itty-router-extras/badge.svg?branch=v0.x\n[coveralls-url]:https://coveralls.io/github/kwhitley/itty-router-extras?branch=v0.x\n\n## Contributors\nThese folks are the real heroes, making open source the powerhouse that it is!  Help out and get your name added to this list! <3\n\n#### Core, Concepts, and Codebase\n- [@mvasigh](https://github.com/mvasigh) - for constantly discussing these ridiculously-in-the-weeds topics with me.  And then for writing the TS interfaces (or simply re-writing in TS), right Mehdi??\n","_id":"itty-router-extras@0.3.0-next.2","dist":{"shasum":"3c38ed3f020fc68714124801cdf26d4b4563ed08","integrity":"sha512-DnydTX21lu8PBpUB13CZ/67lNAg2Zw0KQUdjYQxThmhs5ezgGxRNv2o+0YqRSgkKpZy+Z7KgoUMge7m0jiU8rw==","tarball":"https://registry.npmjs.org/itty-router-extras/-/itty-router-extras-0.3.0-next.2.tgz","fileCount":27,"unpackedSize":17788,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgddAOCRA9TVsSAnZWagAAUu4P+gJfzIdQMfIoFbvSn9xA\nb3poQsYLQvD+7wowMqS4PXPU7/LLlPASSEPzLMnA4mMwljRO3W2chbj4JEIS\nzWAHEqimYuNbhn6M4Iyc9g6nl7zCgHfrcjPJ7UHakR5m8nhSwiL+h9jEWCke\njiBfVBOl9WYgpnuCuxLOGOm/Kr2XzH/do6QNHPOIcSIoljMLaVnzrSS6b4JW\n9EjEvmKLYtgsocAAwwUoEVU1yGwivicw2zAadl6c8PeuCksMUTPt75ttPfab\n7fVCmp3XZtuYnQO+n2UQvRTJ2Bh1+R622mzJjMERP1j+R6YwTyBEBJzw0fRt\ngb8May+03GObFd0XiQwrzex9+4oKSH5QLmF9+W4qjOLTVdYmPV4JNlkZC8sl\nxap+lH96JZDJ7YQPddcV+uH3/0BSATtdUbVyy3eygK7jze3qUFkb5b0NyNzK\nSG0lBHh2LjdmAMbUZZl8ybRwNSMswxa+j6eEA0xErBschPDPI0kINPIpJC9i\n374ACKw2ukXj/3I6hXpfg7Soi/L3TAdsTydWHTIITyl3tt+t4zW0jrrhBwLk\nCiM7siRsyDutOxM/7VrRDJrKQb7+NEqZPEHUqjakbKZFc4U9D88vClG35LLh\noNOdR1heuTkoY5UPP/7wQ/7CNoptp1e1ghVnt+KeHba2F7zGgdo09b9pBgBe\nuxvG\r\n=X9Ia\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFlAkW3ynpsnpoBbhCQWRpQw58NYJd8VhfhyTz7z7jeiAiEA4fisP2QJkJ3rTH4cocBoOqipzDb/jj/w5LUAf/7joWI="}]},"_npmUser":{"name":"krwhitley","email":"krwhitley@gmail.com"},"directories":{},"maintainers":[{"name":"mvasigh","email":"mehdivasigh@gmail.com"},{"name":"krwhitley","email":"krwhitley@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/itty-router-extras_0.3.0-next.2_1618333709658_0.22011307302515015"},"_hasShrinkwrap":false},"0.4.0":{"name":"itty-router-extras","version":"0.4.0","description":"An assortment of delicious extras for the calorie-light itty-router.","main":"./index.js","keywords":["router","cloudflare","workers","serverless","regex","routing","api","handler","params","middleware","nested","helpers","utils","cookies","content","cors"],"scripts":{"lint":"npx eslint src","test":"yarn lint && jest --verbose --coverage src","verify":"echo 'verifying module...' && yarn build && yarn test","dev":"yarn lint && jest --verbose --watch src","coveralls":"cat ./coverage/lcov.info | node node_modules/.bin/coveralls","prerelease":"yarn verify","prebuild":"rimraf dist","build":"terser-folder src -eo dist --pattern '**/*.js,!**/*spec.js' -x .js","release":"release --tag --push --src=dist"},"repository":{"type":"git","url":"git+https://github.com/kwhitley/itty-router-extras.git"},"author":{"name":"Kevin R. Whitley","email":"krwhitley@gmail.com"},"license":"MIT","bugs":{"url":"https://github.com/kwhitley/itty-router-extras/issues"},"homepage":"https://github.com/kwhitley/itty-router-extras#readme","devDependencies":{"chalk":"^4.1.0","coveralls":"^3.1.0","eslint":"^7.22.0","eslint-plugin-jest":"^24.3.2","fs-extra":"^9.1.0","gzip-size":"^6.0.0","isomorphic-fetch":"^3.0.0","itty-router":"^2.3.2","jest":"^26.6.3","rimraf":"^3.0.2","terser":"^5.6.1","terser-folder":"^2.0.0","yarn-release":"^1.10.3"},"_id":"itty-router-extras@0.4.0","dist":{"shasum":"3c6aa4324803ca6f5425ebd8000a7a0c2e61f5ee","integrity":"sha512-0NaPG8sI9lEpkXr36uCARzKkcstqZ1UKBvM9sk6awJviVMndmm5/ffhBuBzzMRrImCvfG2UERDhwuPnl0gJqYw==","tarball":"https://registry.npmjs.org/itty-router-extras/-/itty-router-extras-0.4.0.tgz","fileCount":27,"unpackedSize":17579,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgde84CRA9TVsSAnZWagAAdiAP+gPOH3jBnTq8b2zX366j\neMMbVRnuxPTOs3y8QjcKZAIiTVt76OwOlm7TrVD3eL94VOzLWRPYYeKv0E/7\neqVeA/vtNqdrRQiKHtCW/VjV0BqtdBV9pq2ZfaA823WZZhERIv5x8mv3vkis\n7rZ0yLrIEc3m298fBcVbGEGyAy5NrQOfXL47zOJO8eOav8XiCMAeqzPqtxnS\niPuqZQIzWJbFQqxoace/PGB8NJE6XoMgonY9KbLydO2bKzRejNRRIOR7VCRg\nt1vhycZRm8CgdSwE1vt0fMsPJx5aQfbXf2j8Ip88RDipvCUMIN/NLkgqNlG9\n7tIOuv0sTqxs+K9cCJIFT2F515pR4zMv5L752zYdi2HJ+mvByVZs/9KoFYgv\nNaXfuO6+GVViOyTg/UFxgAAUB5TVxum/NTvbBLx0ROPyVmKD2QuvjgwbZb7e\nYiHpr1c7TI9ZqcP7nBGQwCqBdyeW7WBAMSwDLMv5P7a9BkFNCvcKOg8d0wJA\nNLFDZqSzwgri7vS4EHBjpQPJvBTwRmsDZBhTjlUSdeSz0SAT3shpOxHr3C2u\nEmn/KLVOrRMUeg/dp7QfbjJJocQLBis43rJZM6Ad2HR64PnxF7KwGzKCREgk\n3itM0clR+PxSJbdREBnVmlw6JMlNq5oyHy/5luMSdFa8//qLac8+/J4qW0iS\nikKm\r\n=Gw7Z\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHv1i0JZdfOrPqdni63s9g9KlRqOLKMxo1bUpza6mgOfAiAkRM2R/UdqOGhBB6moE3DaIYtY95cxex4G4f73Kr9S/A=="}]},"_npmUser":{"name":"krwhitley","email":"krwhitley@gmail.com"},"directories":{},"maintainers":[{"name":"mvasigh","email":"mehdivasigh@gmail.com"},{"name":"krwhitley","email":"krwhitley@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/itty-router-extras_0.4.0_1618341687936_0.6461691169249331"},"_hasShrinkwrap":false},"0.4.1":{"name":"itty-router-extras","version":"0.4.1","description":"An assortment of delicious extras for the calorie-light itty-router.","main":"./index.js","keywords":["router","cloudflare","workers","serverless","regex","routing","api","handler","params","middleware","nested","helpers","utils","cookies","content","cors"],"scripts":{"lint":"npx eslint src","test":"yarn lint && jest --verbose --coverage src","verify":"echo 'verifying module...' && yarn build && yarn test","dev":"yarn lint && jest --verbose --watch src","coveralls":"cat ./coverage/lcov.info | node node_modules/.bin/coveralls","prerelease":"yarn verify","prebuild":"rimraf dist","build":"terser-folder src -eo dist --pattern '**/*.js,!**/*spec.js' -x .js","release":"release --tag --push --src=dist"},"repository":{"type":"git","url":"git+https://github.com/kwhitley/itty-router-extras.git"},"author":{"name":"Kevin R. Whitley","email":"krwhitley@gmail.com"},"license":"MIT","bugs":{"url":"https://github.com/kwhitley/itty-router-extras/issues"},"homepage":"https://github.com/kwhitley/itty-router-extras#readme","devDependencies":{"chalk":"^4.1.0","coveralls":"^3.1.0","eslint":"^7.22.0","eslint-plugin-jest":"^24.3.2","fs-extra":"^9.1.0","gzip-size":"^6.0.0","isomorphic-fetch":"^3.0.0","itty-router":"^2.3.2","jest":"^26.6.3","rimraf":"^3.0.2","terser":"^5.6.1","terser-folder":"^2.0.0","yarn-release":"^1.10.3"},"_id":"itty-router-extras@0.4.1","dist":{"shasum":"60fd84d04401bbadf5479229a0ff0bb7c707e8c8","integrity":"sha512-x7b0ryH4sG/jv3i/lxv+tCwaAakapIftzZeTFVuTcQtP8WeyxIxVtYgy7oj+OZLnpX4G0GFjt4I2xcmV2FfzIQ==","tarball":"https://registry.npmjs.org/itty-router-extras/-/itty-router-extras-0.4.1.tgz","fileCount":27,"unpackedSize":17729,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgdgJwCRA9TVsSAnZWagAAC98P/1ZtYE55j+M/f+qCLms/\nJBeMxWy2eRw6COWBeuX1ISFrXLjdoTxgq55E+5pvMKybrF5tw8jzrD3DaCy5\nvHUKTZF378HQsVPZ8EzGDYh47PMmj4HLDWsLx1K903idYtR4wMEeOJkXkqMd\nGoyOeTIs4+kZBQGrKMP+ms/gvKqljX6rb9BJIkeNzwn4Dl+giTr+aBtIMf47\n898TMhymHYLLedWwWa/PzAaIOosz5tSZkEqqgFCSVw4Ik4Csr7w1M6ZUvX30\nUgn8frJsnVg4hrESQ8sLKnuBQB5RW3hmKqJMhm/HmZnVwMou/swdEpeetEa6\nxtISKEbnPL306jPWIWp//TkgERg2izJ6kNjGYbn/cKGPknWctKHybUhT07/6\neNCC7fAVgBjPz9KYH/IM5oC/cTcs3n+T4sqrNYBCwU/YIrDwqJczvEFgip2o\nFoV+rszeQhdGxAW90OvGS1GX9aP1vDLlW4zBmZT2rQSVuubjdtOjm1MbiL55\nD5r9aEtC48/v+FG1ELd1D2fA7sn0iN2YpKb9oK3hkQW0N4U+v2fIuHA3d0Tj\nlYNmxp9SK0EqeYfsshbfTgJzan3po9txMU4X4l+ZpcV4PhTI7ML0EcxuWczb\nD7AGpNUugqzbqM+LG/ConNXrY1rNutA7JReygvqrxV/CuqKosHzolL74HmcG\njbnz\r\n=mUjM\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICgwCk5amOt3tPLuAGFZBRmYRRVf+1hMawjZLemddF3OAiA/24je4Dw8cWCQY04BndNBxrIVI8bUwyBbRbNWdqJvpA=="}]},"_npmUser":{"name":"krwhitley","email":"krwhitley@gmail.com"},"directories":{},"maintainers":[{"name":"mvasigh","email":"mehdivasigh@gmail.com"},{"name":"krwhitley","email":"krwhitley@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/itty-router-extras_0.4.1_1618346608319_0.029501125878306445"},"_hasShrinkwrap":false},"0.4.2":{"name":"itty-router-extras","version":"0.4.2","description":"An assortment of delicious extras for the calorie-light itty-router.","main":"./index.js","keywords":["router","cloudflare","workers","serverless","regex","routing","api","handler","params","middleware","nested","helpers","utils","cookies","content","cors"],"scripts":{"lint":"npx eslint src","test":"yarn lint && jest --verbose --coverage src","verify":"echo 'verifying module...' && yarn build && yarn test","dev":"yarn lint && jest --verbose --watch src","coveralls":"cat ./coverage/lcov.info | node node_modules/.bin/coveralls","prerelease":"yarn verify","prebuild":"rimraf dist","build":"terser-folder src -eo dist --pattern '**/*.js,!**/*spec.js' -x .js","release":"release --tag --push --src=dist"},"repository":{"type":"git","url":"git+https://github.com/kwhitley/itty-router-extras.git"},"author":{"name":"Kevin R. Whitley","email":"krwhitley@gmail.com"},"license":"MIT","bugs":{"url":"https://github.com/kwhitley/itty-router-extras/issues"},"homepage":"https://github.com/kwhitley/itty-router-extras#readme","devDependencies":{"chalk":"^4.1.0","coveralls":"^3.1.0","eslint":"^7.22.0","eslint-plugin-jest":"^24.3.2","fs-extra":"^9.1.0","gzip-size":"^6.0.0","isomorphic-fetch":"^3.0.0","itty-router":"^2.3.2","jest":"^26.6.3","rimraf":"^3.0.2","terser":"^5.6.1","terser-folder":"^2.0.0","yarn-release":"^1.10.3"},"_id":"itty-router-extras@0.4.2","dist":{"shasum":"e46891ebea63f09ada74603649d8a6c4ce0c5df7","integrity":"sha512-ppHaBzcTXs7idFSDISehG+8kif2/4aqLCfyY/Y/uIZv79sfEfNmTq9G+rDeqblun/VZRBiXZD8ztYmMS8EOsKw==","tarball":"https://registry.npmjs.org/itty-router-extras/-/itty-router-extras-0.4.2.tgz","fileCount":27,"unpackedSize":17729,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgeKF/CRA9TVsSAnZWagAAnfgP/i/tsifsqWMhQP8wN9F3\nMzT8Xfz1afLsk6LjE1x/2j0EPScI6J4jCfQc20qOn0xSVBFCntWCr1p5S6mB\nmpL73+ze3RhLlGvnHlDxvLKIjy2rDlStbN3hDkTgjFpxZqsK+DjQtpcPKMgs\nltgYeSjKlM06IEJOp7c/ZuYUbgXnRyuE+wQUItSj/JW07nYTUcQU+8nx0Aqm\n7y1MwwyDc3lxy/U7nIvwmrUkTsQK6OFnpRfiJX8eQt92CVnYurCkCMgbeR3T\nIzK4zYbd4PIKYHVEs9M4wGm+D0jJTK0awS0y7ZzqOOHr6fqgZAacXC2Anfjn\n+rkmHMG8U2SVpGkr/1x1H5NOgIDr6CpImMYFslx1HijbkKs5fsADbC4ApqQi\nt9UUH1R3gYINrvbVtc6bnrIwdhvq2MUhW9KEoDSV137lwaIpvYMCAAFBjfg1\nldINDN1ny6BJ0DfR6tJVUvhuQQQOYMK3Lv7yJFBiUfdDFxuPKq9JjI/PgLkL\nrrOL5UkBvA3eD15crlEhmWwY2yTUnccpvrn4uLpHLz4cPwtIiT8x1AGzp93J\nWacw5Dl3GL4lMStK4B7lTa9UxrJU9GypIJ893GeXLKVnXnPZu+Xj98CnBSaS\neynk6JQHTEr0H8L5yy5qdR+aB27CMON5gbVJ6MwkyxoOZ9eAS1n87RXfTm97\n1q3W\r\n=Z1Mc\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCmJkgW8RbEv/pmsMqINPQt+ybtI5GaEgudDwVVuUt1XQIgLxsMGQ1KjBc+xkugcEogRrvWvsKoi3yuKshDePrLl6M="}]},"_npmUser":{"name":"krwhitley","email":"krwhitley@gmail.com"},"directories":{},"maintainers":[{"name":"mvasigh","email":"mehdivasigh@gmail.com"},{"name":"krwhitley","email":"krwhitley@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/itty-router-extras_0.4.2_1618518398485_0.22628467895919546"},"_hasShrinkwrap":false},"0.4.3":{"name":"itty-router-extras","version":"0.4.3","description":"An assortment of delicious extras for the calorie-light itty-router.","main":"./index.js","types":"./dist/itty-router-extras.d.ts","keywords":["router","cloudflare","workers","serverless","regex","routing","api","handler","params","middleware","nested","helpers","utils","cookies","content","cors"],"scripts":{"lint":"npx eslint src","test":"jest --verbose --coverage src","verify":"echo 'verifying module...' && yarn build && yarn test","dev":"yarn lint && jest --verbose --watch src","coveralls":"cat ./coverage/lcov.info | node node_modules/.bin/coveralls","prerelease":"yarn verify","prebuild":"rimraf dist && mkdir dist && cp src/itty-router-extras.d.ts dist","build":"terser-folder src -eo dist --pattern '**/*.js,!**/*spec.js' -x .js","release":"release --tag --push --src=dist"},"repository":{"type":"git","url":"git+https://github.com/kwhitley/itty-router-extras.git"},"author":{"name":"Kevin R. Whitley","email":"krwhitley@gmail.com"},"license":"MIT","bugs":{"url":"https://github.com/kwhitley/itty-router-extras/issues"},"homepage":"https://github.com/kwhitley/itty-router-extras#readme","devDependencies":{"chalk":"^4.1.0","coveralls":"^3.1.0","eslint":"^7.22.0","eslint-plugin-jest":"^24.3.2","fs-extra":"^9.1.0","gzip-size":"^6.0.0","isomorphic-fetch":"^3.0.0","itty-router":"^2.3.2","jest":"^26.6.3","rimraf":"^3.0.2","terser":"^5.6.1","terser-folder":"^2.0.0","yarn-release":"^1.10.3"},"_id":"itty-router-extras@0.4.3","dist":{"shasum":"9c21b755d063b57c172336908a7996a78fb0456b","integrity":"sha512-JpcRG82EoXixAgrAYtCPSZvN+NfTO+wuN+cqQKFhOcT6LtJn3ZKv139jyQ9eV/8I+r0p7dHqFf5eKsbW6kcBWw==","tarball":"https://registry.npmjs.org/itty-router-extras/-/itty-router-extras-0.4.3.tgz","fileCount":3,"unpackedSize":14327,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDvKCpKKaHYOcL7uXlTSC0N3NvFgEpuNYgSDrmPNjXyEgIgVhpaK2nmBxxwT7b5rPrO11khT3s9/b0kNyhMRQqkQHc="}]},"_npmUser":{"name":"krwhitley","email":"krwhitley@gmail.com"},"directories":{},"maintainers":[{"name":"mvasigh","email":"mehdivasigh@gmail.com"},{"name":"krwhitley","email":"krwhitley@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/itty-router-extras_0.4.3_1685131041278_0.9995974888285628"},"_hasShrinkwrap":false},"0.4.4":{"name":"itty-router-extras","version":"0.4.4","description":"An assortment of delicious extras for the calorie-light itty-router.","main":"./index.js","types":"./dist/itty-router-extras.d.ts","keywords":["router","cloudflare","workers","serverless","regex","routing","api","handler","params","middleware","nested","helpers","utils","cookies","content","cors"],"scripts":{"lint":"npx eslint src","test":"jest --verbose --coverage src","verify":"echo 'verifying module...' && yarn build && yarn test","dev":"yarn lint && jest --verbose --watch src","coveralls":"cat ./coverage/lcov.info | node node_modules/.bin/coveralls","prerelease":"yarn verify","prebuild":"rimraf dist && mkdir dist && cp src/itty-router-extras.d.ts dist","build":"terser-folder src -eo dist --pattern '**/*.js,!**/*spec.js' -x .js","release":"release --tag --push --patch --src=dist"},"repository":{"type":"git","url":"git+https://github.com/kwhitley/itty-router-extras.git"},"author":{"name":"Kevin R. Whitley","email":"krwhitley@gmail.com"},"license":"MIT","bugs":{"url":"https://github.com/kwhitley/itty-router-extras/issues"},"homepage":"https://github.com/kwhitley/itty-router-extras#readme","devDependencies":{"chalk":"^4.1.0","coveralls":"^3.1.0","eslint":"^7.22.0","eslint-plugin-jest":"^24.3.2","fs-extra":"^9.1.0","gzip-size":"^6.0.0","isomorphic-fetch":"^3.0.0","itty-router":"^2.3.2","jest":"^26.6.3","rimraf":"^3.0.2","terser":"^5.6.1","terser-folder":"^2.0.0","yarn-release":"^1.10.3"},"_id":"itty-router-extras@0.4.4","dist":{"shasum":"cbc5cc78b7f527ea90d818a93df37edadb4aa7b8","integrity":"sha512-eBxUd522IEYzmtHk1eCuNOQx5nON2YFV+P9UT21poVzijeyK8bsteK9Mkx9Ov3eJISTIIQDD0gPkB3NHCO4APw==","tarball":"https://registry.npmjs.org/itty-router-extras/-/itty-router-extras-0.4.4.tgz","fileCount":3,"unpackedSize":14335,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEexTWRZra/5GiPf7OdFmqjDmN2hILo2IocXp/YWOBvyAiAWH0TbZUeVhSPEeVrzom72pp65i+nv/+n4ntmCpkmS0g=="}]},"_npmUser":{"name":"krwhitley","email":"krwhitley@gmail.com"},"directories":{},"maintainers":[{"name":"mvasigh","email":"mehdivasigh@gmail.com"},{"name":"krwhitley","email":"krwhitley@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/itty-router-extras_0.4.4_1685627588255_0.49612475534559386"},"_hasShrinkwrap":false},"0.4.5":{"name":"itty-router-extras","version":"0.4.5","description":"An assortment of delicious extras for the calorie-light itty-router.","main":"./index.js","keywords":["router","cloudflare","workers","serverless","regex","routing","api","handler","params","middleware","nested","helpers","utils","cookies","content","cors"],"scripts":{"lint":"npx eslint src","test":"jest --verbose --coverage src","verify":"echo 'verifying module...' && yarn build && yarn test","dev":"yarn lint && jest --verbose --watch src","coveralls":"cat ./coverage/lcov.info | node node_modules/.bin/coveralls","prerelease":"yarn verify","prebuild":"rimraf dist && mkdir dist && cp src/itty-router-extras.d.ts dist","build":"terser-folder src -eo dist --pattern '**/*.js,!**/*spec.js' -x .js","release":"release --tag --push --patch --src=dist"},"repository":{"type":"git","url":"git+https://github.com/kwhitley/itty-router-extras.git"},"author":{"name":"Kevin R. Whitley","email":"krwhitley@gmail.com"},"license":"MIT","bugs":{"url":"https://github.com/kwhitley/itty-router-extras/issues"},"homepage":"https://github.com/kwhitley/itty-router-extras#readme","devDependencies":{"chalk":"^4.1.0","coveralls":"^3.1.0","eslint":"^7.22.0","eslint-plugin-jest":"^24.3.2","fs-extra":"^9.1.0","gzip-size":"^6.0.0","isomorphic-fetch":"^3.0.0","itty-router":"^2.3.2","jest":"^26.6.3","rimraf":"^3.0.2","terser":"^5.6.1","terser-folder":"^2.0.0","yarn-release":"^1.10.3"},"_id":"itty-router-extras@0.4.5","dist":{"shasum":"9f3fec9da1fe7e04a6a101e7741fd587967b277d","integrity":"sha512-flxFhFZgPqiscrHTV3mBbRBk8plgOGdg5tZMyv7hE629PO+XEfXh2uHs78ndH6axRG50fIHfjrrqAlb3Pguemw==","tarball":"https://registry.npmjs.org/itty-router-extras/-/itty-router-extras-0.4.5.tgz","fileCount":28,"unpackedSize":19026,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDpXMRrKhNEhgtJDCBtytZVgnGi+RkxIJj/uIO/RB2xSwIgF2qV1NVmNEnnaimgX0unKeH6VZ/eb3INwuIQxLkK63U="}]},"_npmUser":{"name":"krwhitley","email":"krwhitley@gmail.com"},"directories":{},"maintainers":[{"name":"mvasigh","email":"mehdivasigh@gmail.com"},{"name":"krwhitley","email":"krwhitley@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/itty-router-extras_0.4.5_1685628084604_0.8360084003956993"},"_hasShrinkwrap":false},"0.4.6":{"name":"itty-router-extras","version":"0.4.6","description":"An assortment of delicious extras for the calorie-light itty-router.","main":"./index.js","keywords":["router","cloudflare","workers","serverless","regex","routing","api","handler","params","middleware","nested","helpers","utils","cookies","content","cors"],"scripts":{"lint":"npx eslint src","test":"jest --verbose --coverage src","verify":"echo 'verifying module...' && yarn build && yarn test","dev":"yarn lint && jest --verbose --watch src","coveralls":"cat ./coverage/lcov.info | node node_modules/.bin/coveralls","prerelease":"yarn verify","prebuild":"rimraf dist && mkdir dist && cp src/itty-router-extras.d.ts dist","build":"terser-folder src -eo dist --pattern '**/*.js,!**/*spec.js' -x .js","release":"release --tag --push --patch --src=dist"},"repository":{"type":"git","url":"git+https://github.com/kwhitley/itty-router-extras.git"},"author":{"name":"Kevin R. Whitley","email":"krwhitley@gmail.com"},"license":"MIT","bugs":{"url":"https://github.com/kwhitley/itty-router-extras/issues"},"homepage":"https://github.com/kwhitley/itty-router-extras#readme","devDependencies":{"chalk":"^4.1.0","coveralls":"^3.1.0","eslint":"^7.22.0","eslint-plugin-jest":"^24.3.2","fs-extra":"^9.1.0","gzip-size":"^6.0.0","isomorphic-fetch":"^3.0.0","itty-router":"^2.3.2","jest":"^26.6.3","rimraf":"^3.0.2","terser":"^5.6.1","terser-folder":"^2.0.0","yarn-release":"^1.10.3"},"_id":"itty-router-extras@0.4.6","dist":{"shasum":"dafaa23ead46180197b7a97c2f766d30d2fe2e94","integrity":"sha512-6r7HQBkFMPSJfcKksrKC7avEQnPCSSEvoz6PAAZMNhz8hthYu1pzedXDrvTFDWXJosfuaittzoNciWHO/TxMaw==","tarball":"https://registry.npmjs.org/itty-router-extras/-/itty-router-extras-0.4.6.tgz","fileCount":28,"unpackedSize":8637,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHEjLJxIrHG9gPSXuaySYthjsHkquRZgfcNHqEXb0oniAiBrZbnNwz8EapB3Q4p9dhBbGpwt9lnESTSRqeHBNE83vA=="}]},"_npmUser":{"name":"krwhitley","email":"krwhitley@gmail.com"},"directories":{},"maintainers":[{"name":"mvasigh","email":"mehdivasigh@gmail.com"},{"name":"krwhitley","email":"krwhitley@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/itty-router-extras_0.4.6_1711993895857_0.5734997312723922"},"_hasShrinkwrap":false}},"time":{"created":"2021-03-26T18:57:51.605Z","0.1.0":"2021-03-26T18:57:51.784Z","modified":"2024-04-01T17:51:36.190Z","0.1.1":"2021-03-26T18:58:49.155Z","0.2.0":"2021-03-27T03:36:53.045Z","0.2.1":"2021-03-27T05:03:33.689Z","0.2.2":"2021-03-29T18:01:42.065Z","0.2.3":"2021-03-30T16:19:09.798Z","0.3.0":"2021-04-04T06:11:02.406Z","0.3.0-next.0":"2021-04-04T17:12:30.986Z","0.3.0-next.1":"2021-04-12T06:10:20.640Z","0.3.0-next.2":"2021-04-13T17:08:29.800Z","0.4.0":"2021-04-13T19:21:28.251Z","0.4.1":"2021-04-13T20:43:28.498Z","0.4.2":"2021-04-15T20:26:38.644Z","0.4.3":"2023-05-26T19:57:21.414Z","0.4.4":"2023-06-01T13:53:08.409Z","0.4.5":"2023-06-01T14:01:24.775Z","0.4.6":"2024-04-01T17:51:36.035Z"},"maintainers":[{"name":"mvasigh","email":"mehdivasigh@gmail.com"},{"name":"krwhitley","email":"krwhitley@gmail.com"}],"description":"An assortment of delicious extras for the calorie-light itty-router.","homepage":"https://github.com/kwhitley/itty-router-extras#readme","keywords":["router","cloudflare","workers","serverless","regex","routing","api","handler","params","middleware","nested","helpers","utils","cookies","content","cors"],"repository":{"type":"git","url":"git+https://github.com/kwhitley/itty-router-extras.git"},"author":{"name":"Kevin R. Whitley","email":"krwhitley@gmail.com"},"bugs":{"url":"https://github.com/kwhitley/itty-router-extras/issues"},"license":"MIT","readme":"# ![Itty Router][logo-image]\n\n[![npm package][npm-image]][npm-url]\n[![Build Status][travis-image]][travis-url]\n[![Coverage Status][coveralls-image]][coveralls-url]\n[![Open Issues][issues-image]][issues-url]\n<a href=\"https://github.com/kwhitley/itty-router-extras\" target=\"\\_parent\">\n  <img alt=\"\" src=\"https://img.shields.io/github/stars/kwhitley/itty-router-extras.svg?style=social&label=Star\" />\n</a>\n<a href=\"https://twitter.com/kevinrwhitley\" target=\"\\_parent\">\n  <img alt=\"\" src=\"https://img.shields.io/twitter/follow/kevinrwhitley.svg?style=social&label=Follow\" />\n</a>\n\n# Deprecation Notice\n_`itty-router-extras` has been fully deprecated in favor of using the built-in helpers within [`itty-router`](https://itty.dev/itty-router) itself._\n\n#### Before\n```ts\nimport { Router } from 'itty-router'\nimport { json, withParams, withContent, error } from 'itty-router-extras'\n```\n\n#### Now\n```ts\nimport { Router, json, withParams, withContent, error } from 'itty-router'\n```\n\n### v5.x Migration Guide\nhttps://itty.dev/itty-router/migrations/v4-v5\n\n[twitter-image]:https://img.shields.io/twitter/url?style=social&url=https%3A%2F%2Fwww.npmjs.com%2Fpackage%2Fitty-router-extras\n[logo-image]:https://user-images.githubusercontent.com/865416/112549341-a4377300-8d8b-11eb-8977-574967dede99.png\n[gzip-image]:https://img.shields.io/bundlephobia/minzip/itty-router-extras\n[gzip-url]:https://bundlephobia.com/result?p=itty-router-extras\n[issues-image]:https://img.shields.io/github/issues/kwhitley/itty-router-extras\n[issues-url]:https://github.com/kwhitley/itty-router-extras/issues\n[npm-image]:https://img.shields.io/npm/v/itty-router-extras.svg\n[npm-url]:http://npmjs.org/package/itty-router-extras\n[travis-image]:https://travis-ci.org/kwhitley/itty-router-extras.svg?branch=v0.x\n[travis-url]:https://travis-ci.org/kwhitley/itty-router-extras\n[david-image]:https://david-dm.org/kwhitley/itty-router-extras/status.svg\n[david-url]:https://david-dm.org/kwhitley/itty-router-extras\n[coveralls-image]:https://coveralls.io/repos/github/kwhitley/itty-router-extras/badge.svg?branch=v0.x\n[coveralls-url]:https://coveralls.io/github/kwhitley/itty-router-extras?branch=v0.x\n","readmeFilename":"README.md"}