{"_id":"koa-json-error","_rev":"25-641645aa858c06cd50343fe455c49261","name":"koa-json-error","description":"Error handler for pure-JSON Koa apps","dist-tags":{"latest":"3.1.2","next":"3.0.1"},"versions":{"1.0.0":{"name":"koa-json-error","description":"Error handler for pure-JSON apps","version":"1.0.0","author":{"name":"Jonathan Ong","email":"me@jongleberry.com","url":"http://jongleberry.com"},"license":"MIT","repository":{"type":"git","url":"git://github.com/koajs/json-error"},"devDependencies":{"koa":"0","mocha":"1","should":"3","supertest":"0"},"scripts":{"test":"mocha --harmony-generators --require should --reporter spec --bail"},"bugs":{"url":"https://github.com/koajs/json-error/issues"},"homepage":"https://github.com/koajs/json-error","_id":"koa-json-error@1.0.0","dist":{"shasum":"a2c9c1d80fa037e949e0048c657d2e3e497c0ccb","tarball":"https://registry.npmjs.org/koa-json-error/-/koa-json-error-1.0.0.tgz","integrity":"sha512-nXiWXJnvWTrKOEfBe9YAxUV3NG05ii3GXYCGzoy1OsYJVd3NZqNLx0YM7uSxczrz84JzcvkkDgy+IipLFV0XYA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCTG+TkAFAeZa85qAFG/tviQ3FQyu4BAlCl92f33pLKrAIhAMt6MkwYlkAn02+MDHm3MLq2vGbDALCFt1CNuUN6beBz"}]},"_from":".","_npmVersion":"1.4.6","_npmUser":{"name":"jongleberry","email":"jonathanrichardong@gmail.com"},"maintainers":[{"name":"jongleberry","email":"jonathanrichardong@gmail.com"}],"directories":{}},"1.0.1":{"name":"koa-json-error","description":"Error handler for pure-JSON apps","version":"1.0.1","author":{"name":"Jonathan Ong","email":"me@jongleberry.com","url":"http://jongleberry.com"},"license":"MIT","repository":{"type":"git","url":"git://github.com/koajs/json-error"},"devDependencies":{"koa":"0","mocha":"1","should":"3","supertest":"0"},"scripts":{"test":"mocha --harmony-generators --require should --reporter spec --bail"},"bugs":{"url":"https://github.com/koajs/json-error/issues"},"homepage":"https://github.com/koajs/json-error","_id":"koa-json-error@1.0.1","dist":{"shasum":"f0b651b3d4a2c7fd97eff4813ad661874874b160","tarball":"https://registry.npmjs.org/koa-json-error/-/koa-json-error-1.0.1.tgz","integrity":"sha512-JcE2KXLrvqr3Q5IasNxiyUzDJbChhwEYeTgLqdekvn5a1agASo2JDHwCCFbHrtlH3kQTyY02Y1AvAlGDWIBWew==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEw8WGEutWFURWDsCzSmdeXpLJ7Af+kGW9WKHPsigEYWAiBqJjkRAeY1sL8X4WcXYlVPGUvcsm/cJm6KwXz8gWiD7A=="}]},"_from":".","_npmVersion":"1.4.6","_npmUser":{"name":"jongleberry","email":"jonathanrichardong@gmail.com"},"maintainers":[{"name":"jongleberry","email":"jonathanrichardong@gmail.com"}],"directories":{}},"2.0.0":{"name":"koa-json-error","version":"2.0.0","description":"Error handler for pure-JSON apps","keywords":["koa","json","error","api","handler","middleware"],"bugs":{"url":"https://github.com/koajs/json-error/issues"},"license":"MIT","author":{"name":"Jonathan Ong","email":"me@jongleberry.com","url":"http://jongleberry.com"},"contributors":[{"name":"Nicolás Fantone","email":"nfantone@gmail.com","url":"https://github.com/nfantone"}],"files":["index.js"],"main":"index.js","repository":{"type":"git","url":"git+https://github.com/koajs/json-error.git"},"scripts":{"test":"NODE_ENV=test mocha --reporter spec","test-cov":"NODE_ENV=test node ./node_modules/.bin/istanbul cover ./node_modules/.bin/_mocha","test-travis":"NODE_ENV=test node ./node_modules/.bin/istanbul cover ./node_modules/.bin/_mocha --report lcovonly"},"dependencies":{"lodash.assign":"^4.0.7","lodash.defaults":"^4.0.1"},"devDependencies":{"babel-eslint":"^6.0.2","codecov":"^1.0.1","eslint":"^2.7.0","eslint-config-standard":"^5.1.0","eslint-plugin-babel":"^3.2.0","eslint-plugin-promise":"^1.1.0","eslint-plugin-standard":"^1.3.2","istanbul":"^0.4.3","koa":"1.2.0","mocha":"2.4.5","pre-commit":"^1.1.2","supertest":"1.2.0"},"engines":{"node":">=4.0.0"},"pre-commit":"test","gitHead":"20428caf9d455522d4d6ab512123fa283ba34cac","homepage":"https://github.com/koajs/json-error#readme","_id":"koa-json-error@2.0.0","_shasum":"31c8aebcbb9299df42304653e7bc1cd6279eb88b","_from":".","_npmVersion":"3.8.3","_nodeVersion":"5.10.0","_npmUser":{"name":"nfantone","email":"nfantone@gmail.com"},"dist":{"shasum":"31c8aebcbb9299df42304653e7bc1cd6279eb88b","tarball":"https://registry.npmjs.org/koa-json-error/-/koa-json-error-2.0.0.tgz","integrity":"sha512-Zfr+/+pjxYZlDkz/43iyGm0Xw153aDt/8iUt5f57ACN41dSsECYp9oT7Co11YuPMomju1XCZfTbv1c0u2vVQfQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFiLR7xpoBp3vBZlEXlcECHyTBbji9rKVv5Lk7NTSBZ0AiEAsPee3kpKC5mhcTCYwzZiUT/vHNbnAjKaJdSFnYSnYS8="}]},"maintainers":[{"name":"aheckmann","email":"aaron.heckmann+github@gmail.com"},{"name":"coderhaoxin","email":"coderhaoxin@outlook.com"},{"name":"jongleberry","email":"jonathanrichardong@gmail.com"},{"name":"nfantone","email":"nfantone@gmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/koa-json-error-2.0.0.tgz_1460318722121_0.22409430472180247"},"directories":{}},"3.0.0":{"name":"koa-json-error","version":"3.0.0","description":"Error handler for pure-JSON Koa apps","keywords":["koa","json","error","api","handler","middleware"],"bugs":{"url":"https://github.com/koajs/json-error/issues"},"license":"MIT","author":{"name":"Jonathan Ong","email":"me@jongleberry.com","url":"http://jongleberry.com"},"contributors":[{"name":"Nicolás Fantone","email":"nfantone@gmail.com","url":"https://github.com/nfantone"}],"files":["index.js"],"main":"index.js","repository":{"type":"git","url":"git+https://github.com/koajs/json-error.git"},"scripts":{"test":"NODE_ENV=test mocha --reporter spec","test-cov":"NODE_ENV=test node ./node_modules/.bin/istanbul cover ./node_modules/.bin/_mocha","test-travis":"NODE_ENV=test node ./node_modules/.bin/istanbul cover ./node_modules/.bin/_mocha --report lcovonly"},"dependencies":{"lodash.assign":"^4.0.7","lodash.compact":"^3.0.1","lodash.defaults":"^4.0.1"},"devDependencies":{"babel-eslint":"^6.0.2","codecov":"^1.0.1","eslint":"^2.7.0","eslint-config-standard":"^5.1.0","eslint-plugin-babel":"^3.2.0","eslint-plugin-promise":"^1.1.0","eslint-plugin-standard":"^1.3.2","istanbul":"^0.4.3","koa":"^2.0.0","mocha":"2.4.5","pre-commit":"^1.1.2","supertest":"1.2.0"},"engines":{"node":">=4.0.0"},"pre-commit":"test","gitHead":"41c67e73af76cf767d0f048b22e8509aa4f1f5bd","homepage":"https://github.com/koajs/json-error#readme","_id":"koa-json-error@3.0.0","_shasum":"39f4b8d73d3ccc40af77e0d58f38f547fd2d36f8","_from":".","_npmVersion":"3.8.3","_nodeVersion":"5.10.0","_npmUser":{"name":"nfantone","email":"nfantone@gmail.com"},"dist":{"shasum":"39f4b8d73d3ccc40af77e0d58f38f547fd2d36f8","tarball":"https://registry.npmjs.org/koa-json-error/-/koa-json-error-3.0.0.tgz","integrity":"sha512-D51hpDKNgc++niALuz1pDP+4hfffNXBh+ytFTcVrRyHKh88Q1tfkcOhJo78ZxvfpRRNGs1Z+49vJ0YC35KsmYw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDVdTLuJb6VXqJLkpQrk3l4I2TbifyAkNEvhxqZNKgsKAiBac9HG/FEn01jGEW93t9+L1M29cz/LY+06zvElX7UDbQ=="}]},"maintainers":[{"name":"aheckmann","email":"aaron.heckmann+github@gmail.com"},{"name":"coderhaoxin","email":"coderhaoxin@outlook.com"},{"name":"jongleberry","email":"jonathanrichardong@gmail.com"},{"name":"nfantone","email":"nfantone@gmail.com"}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/koa-json-error-3.0.0.tgz_1460330935051_0.2344759637489915"},"directories":{}},"3.0.1":{"name":"koa-json-error","version":"3.0.1","description":"Error handler for pure-JSON Koa apps","keywords":["koa","json","error","api","handler","middleware"],"bugs":{"url":"https://github.com/koajs/json-error/issues"},"license":"MIT","author":{"name":"Jonathan Ong","email":"me@jongleberry.com","url":"http://jongleberry.com"},"contributors":[{"name":"Nicolás Fantone","email":"nfantone@gmail.com","url":"https://github.com/nfantone"}],"files":["index.js"],"main":"index.js","repository":{"type":"git","url":"git+https://github.com/koajs/json-error.git"},"scripts":{"lint":"eslint *.js","test":"NODE_ENV=test mocha --reporter spec","test-cov":"NODE_ENV=test istanbul cover mocha","test-travis":"NODE_ENV=test && istanbul cover mocha --report lcovonly && codecov"},"dependencies":{"lodash.assign":"^4.0.9","lodash.compact":"^3.0.1","lodash.defaults":"^4.0.1"},"devDependencies":{"eslint":"^3.1.1","babel-eslint":"^6.1.2","codecov":"^1.0.1","eslint-config-standard":"^5.3.5","eslint-plugin-babel":"^3.3.0","eslint-plugin-promise":"^2.0.0","eslint-plugin-standard":"^2.0.0","istanbul":"^0.4.4","koa":"^2.0.0","mocha":"2.5.3","pre-commit":"^1.1.3","supertest":"1.2.0"},"engines":{"node":">=4.0.0"},"pre-commit":"test","gitHead":"87fe809b96c132ba9ec9fa50a192690dc6c1829a","homepage":"https://github.com/koajs/json-error#readme","_id":"koa-json-error@3.0.1","_shasum":"5be8e16b686dc8143857c6c0e4c6f620b16fb350","_from":".","_npmVersion":"3.8.6","_nodeVersion":"5.12.0","_npmUser":{"name":"nfantone","email":"nfantone@gmail.com"},"dist":{"shasum":"5be8e16b686dc8143857c6c0e4c6f620b16fb350","tarball":"https://registry.npmjs.org/koa-json-error/-/koa-json-error-3.0.1.tgz","integrity":"sha512-dURXNIkerAd2sy4i+Hj+RwEPe6vJllF1lsxzhk82zfdl+ZOgoK9ibRmmdHbi52fiaeohqwzSwnUFCc6TMNgn+g==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIH0WmAG+3RRSUie4GGkTDg/aZGSiIpyYskCcbZEiWIc+AiEAxFqKPpXVm4MGzdGRebNwUZFv1Am/EJOJZ9kvIDH0ssg="}]},"maintainers":[{"name":"aheckmann","email":"aaron.heckmann+github@gmail.com"},{"name":"coderhaoxin","email":"coderhaoxin@outlook.com"},{"name":"jongleberry","email":"jonathanrichardong@gmail.com"},{"name":"nfantone","email":"nfantone@gmail.com"}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/koa-json-error-3.0.1.tgz_1469211934694_0.5905376800801605"},"directories":{}},"3.0.2":{"name":"koa-json-error","version":"3.0.2","description":"Error handler for pure-JSON Koa apps","keywords":["koa","json","error","api","handler","middleware"],"bugs":{"url":"https://github.com/koajs/json-error/issues"},"license":"MIT","author":{"name":"Jonathan Ong","email":"me@jongleberry.com","url":"http://jongleberry.com"},"contributors":[{"name":"Nicolás Fantone","email":"nfantone@gmail.com","url":"https://github.com/nfantone"}],"files":["index.js"],"main":"index.js","repository":{"type":"git","url":"git+https://github.com/koajs/json-error.git"},"scripts":{"lint":"eslint *.js","test":"NODE_ENV=test mocha --reporter spec","test-cov":"NODE_ENV=test istanbul cover _mocha","test-travis":"NODE_ENV=test istanbul cover _mocha --report lcovonly && codecov"},"dependencies":{"lodash.compact":"^3.0.1","lodash.defaults":"^4.2.0"},"devDependencies":{"eslint":"^3.5.0","babel-eslint":"^7.0.0","codecov":"^1.0.1","eslint-config-standard":"^6.0.1","eslint-plugin-babel":"^3.3.0","eslint-plugin-promise":"^2.0.1","eslint-plugin-standard":"^2.0.0","istanbul":"^0.4.5","koa":"^2.0.0","mocha":"3.1.0","pre-commit":"^1.1.3","supertest":"2.0.0"},"engines":{"node":">=4.0.0"},"pre-commit":"test","gitHead":"6622ffe7630ceda1ad2650a746148390f9dd564b","homepage":"https://github.com/koajs/json-error#readme","_id":"koa-json-error@3.0.2","_shasum":"46d3b76a739ac2236fbe8267980ebe06485414e8","_from":".","_npmVersion":"3.10.8","_nodeVersion":"6.7.0","_npmUser":{"name":"nfantone","email":"nfantone@gmail.com"},"dist":{"shasum":"46d3b76a739ac2236fbe8267980ebe06485414e8","tarball":"https://registry.npmjs.org/koa-json-error/-/koa-json-error-3.0.2.tgz","integrity":"sha512-Wl+xFc9s56fgyG76EHHhtlhRXvtP5e5aw8mFN+TsELqhW3nwPyAnikTW0GTCb/e/Ay5XjNPmokIYm1lXpcu/ug==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC2JLZZxuK6C/2pFCP7xPZHr3vvBCHvNpqJC3Z8LcT86QIgDQ9oyfl4rookHYUIsnSDi43kSMXMZFv9zd218SL5V1I="}]},"maintainers":[{"name":"aheckmann","email":"aaron.heckmann+github@gmail.com"},{"name":"coderhaoxin","email":"coderhaoxin@outlook.com"},{"name":"jongleberry","email":"jonathanrichardong@gmail.com"},{"name":"nfantone","email":"nfantone@gmail.com"}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/koa-json-error-3.0.2.tgz_1475770807188_0.921601286623627"},"directories":{}},"3.1.0":{"name":"koa-json-error","version":"3.1.0","description":"Error handler for pure-JSON Koa apps","keywords":["koa","json","error","api","handler","middleware"],"bugs":{"url":"https://github.com/koajs/json-error/issues"},"license":"MIT","author":{"name":"Jonathan Ong","email":"me@jongleberry.com","url":"http://jongleberry.com"},"contributors":[{"name":"Nicolás Fantone","email":"nfantone@gmail.com","url":"https://github.com/nfantone"}],"files":["index.js"],"main":"index.js","repository":{"type":"git","url":"git+https://github.com/koajs/json-error.git"},"scripts":{"lint":"eslint *.js","test":"NODE_ENV=test mocha --reporter spec","test-cov":"NODE_ENV=test istanbul cover _mocha","test-travis":"NODE_ENV=test istanbul cover _mocha --report lcovonly && codecov"},"dependencies":{"lodash.compact":"^3.0.1","lodash.defaults":"^4.2.0","lodash.isfunction":"^3.0.8"},"devDependencies":{"eslint":"^3.5.0","babel-eslint":"^7.0.0","codecov":"^1.0.1","eslint-config-standard":"^6.0.1","eslint-plugin-babel":"^3.3.0","eslint-plugin-promise":"^2.0.1","eslint-plugin-standard":"^2.0.0","istanbul":"^0.4.5","koa":"^2.0.0","mocha":"3.1.0","pre-commit":"^1.1.3","supertest":"2.0.0"},"engines":{"node":">=4.0.0"},"pre-commit":"test","gitHead":"90ce3fc2c1e27609df4a0eaa1222cdedc1cd528a","homepage":"https://github.com/koajs/json-error#readme","_id":"koa-json-error@3.1.0","_shasum":"092381f2fac96f380c5c26cd75003e1c6504596c","_from":".","_npmVersion":"3.10.8","_nodeVersion":"6.7.0","_npmUser":{"name":"nfantone","email":"nfantone@gmail.com"},"dist":{"shasum":"092381f2fac96f380c5c26cd75003e1c6504596c","tarball":"https://registry.npmjs.org/koa-json-error/-/koa-json-error-3.1.0.tgz","integrity":"sha512-VPzrxUWUrQBvLblTr3IW2njHCVF8yrHEyArHX7O6+som9a0w6a9U4rQCU/bZDAnz3tz9w3YkUOCjYZvEi92bmA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHRsapMwYc8CKMVOITn/bnJoAPspXQIsykqUusC2LJf/AiAcyi56WEXsM5zW/Ns3VI9ruPvfq6YjgbxjsxioYsB6kw=="}]},"maintainers":[{"name":"aheckmann","email":"aaron.heckmann+github@gmail.com"},{"name":"coderhaoxin","email":"coderhaoxin@outlook.com"},{"name":"jongleberry","email":"jonathanrichardong@gmail.com"},{"name":"nfantone","email":"nfantone@gmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/koa-json-error-3.1.0.tgz_1475860444690_0.6983672026544809"},"directories":{}},"3.1.1":{"name":"koa-json-error","version":"3.1.1","description":"Error handler for pure-JSON Koa apps","keywords":["koa","json","error","api","handler","middleware"],"bugs":{"url":"https://github.com/koajs/json-error/issues"},"license":"MIT","author":{"name":"Nicolás Fantone","email":"nfantone@gmail.com","url":"https://github.com/nfantone"},"contributors":[{"name":"Jonathan Ong","email":"me@jongleberry.com","url":"http://jongleberry.com"}],"files":["index.js"],"main":"index.js","repository":{"type":"git","url":"git+https://github.com/koajs/json-error.git"},"scripts":{"lint":"eslint *.js test/","test":"NODE_ENV=test mocha --reporter spec","coverage":"nyc npm run test","report-coverage":"nyc report --reporter=lcov > coverage.lcov && codecov","validate":"npm-run-all lint coverage","ci":"npm-run-all validate report-coverage"},"dependencies":{"lodash.compact":"^3.0.1","lodash.curry":"^4.1.1"},"devDependencies":{"babel-eslint":"^7.1.1","codecov":"^2.0.1","eslint":"^3.17.1","eslint-config-standard":"^7.0.1","eslint-plugin-babel":"^4.1.1","eslint-plugin-promise":"^3.5.0","eslint-plugin-standard":"^2.1.1","koa":"^2.2.0","mocha":"3.2.0","npm-run-all":"^4.0.2","nyc":"^10.1.2","pre-commit":"^1.2.2","supertest":"3.0.0"},"engines":{"node":">=6.0.0"},"pre-commit":"test","gitHead":"c58db963548e7cbddad0d9d14cc79f5acf5aa72c","homepage":"https://github.com/koajs/json-error#readme","_id":"koa-json-error@3.1.1","_shasum":"161764a4f0e8a72e7360bbdcbf01587cea7e04d6","_from":".","_npmVersion":"4.4.1","_nodeVersion":"7.7.3","_npmUser":{"name":"nfantone","email":"nfantone@gmail.com"},"dist":{"shasum":"161764a4f0e8a72e7360bbdcbf01587cea7e04d6","tarball":"https://registry.npmjs.org/koa-json-error/-/koa-json-error-3.1.1.tgz","integrity":"sha512-2ql1Q+C3CNAq3zs+61eYDVuaiEFU+vvCDm7l+AR2FnZYZiSIXF7Bi/x9zuseePnWO/cuPNBdknC+npryeQeXdg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAm1b3YG0vNRd8zb20XIDFSWkCUQiPgo+XI+ALAjY+fFAiBiMpHKTqb0brR+ye9zpaeQwzDwzJe9c9vrRbXZcmyFaQ=="}]},"maintainers":[{"name":"aheckmann","email":"aaron.heckmann+github@gmail.com"},{"name":"coderhaoxin","email":"coderhaoxin@outlook.com"},{"name":"jongleberry","email":"jonathanrichardong@gmail.com"},{"name":"nfantone","email":"nfantone@gmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/koa-json-error-3.1.1.tgz_1490102879192_0.019593408796936274"},"directories":{}},"3.1.2":{"name":"koa-json-error","version":"3.1.2","description":"Error handler for pure-JSON Koa apps","keywords":["koa","json","error","api","handler","middleware"],"bugs":{"url":"https://github.com/koajs/json-error/issues"},"license":"MIT","author":{"name":"Nicolás Fantone","email":"nfantone@gmail.com","url":"https://github.com/nfantone"},"contributors":[{"name":"Jonathan Ong","email":"me@jongleberry.com","url":"http://jongleberry.com"}],"files":["index.js","lib/"],"main":"index.js","repository":{"type":"git","url":"git+https://github.com/koajs/json-error.git"},"scripts":{"lint":"eslint *.js test/","test":"NODE_ENV=test mocha --reporter spec","coverage":"nyc npm run test","report-coverage":"nyc report --reporter=lcov > coverage.lcov && codecov","validate":"npm-run-all lint coverage","ci":"npm-run-all validate report-coverage"},"dependencies":{"lodash.compact":"^3.0.1","lodash.curry":"^4.1.1"},"devDependencies":{"babel-eslint":"^7.1.1","codecov":"^2.0.1","eslint":"^3.17.1","eslint-config-standard":"^7.0.1","eslint-plugin-babel":"^4.1.1","eslint-plugin-promise":"^3.5.0","eslint-plugin-standard":"^2.1.1","koa":"^2.2.0","mocha":"3.2.0","npm-run-all":"^4.0.2","nyc":"^10.1.2","pre-commit":"^1.2.2","supertest":"3.0.0"},"engines":{"node":">=6.0.0"},"pre-commit":"test","gitHead":"ee27490adff504de97095ea6a4fb3620c2da6e28","homepage":"https://github.com/koajs/json-error#readme","_id":"koa-json-error@3.1.2","_shasum":"acad750c6739cb12cc4ea6c25f224d59b765abfe","_from":".","_npmVersion":"4.4.1","_nodeVersion":"7.7.3","_npmUser":{"name":"nfantone","email":"nfantone@gmail.com"},"dist":{"shasum":"acad750c6739cb12cc4ea6c25f224d59b765abfe","tarball":"https://registry.npmjs.org/koa-json-error/-/koa-json-error-3.1.2.tgz","integrity":"sha512-nqfNwD4W+hYaJijFl+6qNSQJHbTS4vp+gXTdXl5U8YK2PVNzCF0HnLZwyKHaMeBebhanAgmfheQv96wLDjLRxg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIELZ/wWS7P+TvIamMQMgP5tIlXnLGpoXAGXf47wrZ7fRAiEAkdqS1Wd8HlHLXVRzGn8tas8TqeNb1/XX4LmH8GIdlE4="}]},"maintainers":[{"name":"aheckmann","email":"aaron.heckmann+github@gmail.com"},{"name":"coderhaoxin","email":"coderhaoxin@outlook.com"},{"name":"jongleberry","email":"jonathanrichardong@gmail.com"},{"name":"nfantone","email":"nfantone@gmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/koa-json-error-3.1.2.tgz_1490104100187_0.6664275862276554"},"directories":{}}},"readme":"# Koa JSON Error\n\n[![NPM version][npm-image]][npm-url]\n[![Build status][travis-image]][travis-url]\n[![Test coverage][codecov-image]][codecov-url]\n[![Dependency Status][david-image]][david-url]\n[![License][license-image]][license-url]\n[![Downloads][downloads-image]][downloads-url]\n\nError handler for pure [Koa](https://koajs.com) `>=2.0.0` JSON apps where showing the stack trace is _cool!_\n\n```sh\nnpm install --save koa-json-error\n```\n\n> Versions `>=3.0.0` support Koa `^2.0.0`. For earlier versions of Koa, _please use previous releases_.\n\n## Requirements\n- node `>=6.0.0`\n- koa `>=2.2.0`\n\n> Starting from `3.2.0`, this package supports node `>=6.0.0` to match [Koa requirements][koa-requirements].\n\n\n## API\n\n```js\n'use strict';\nconst koa = require('koa');\nconst error = require('koa-json-error')\n\nlet app = new Koa();\napp.use(error())\n```\n\nIf you don't really feel that showing the stack trace is _that_ cool, you can customize the way errors are shown on responses. There's a **basic** and more **advanced**, granular approach to this.\n\n### Basic usage\nYou can provide a _single formatter function_ as an argument on middleware initialization. It receives the original raised error and it is expected to return a formatted response.\n\nHere's a simple example:\n\n```js\n'use strict';\nconst koa = require('koa');\nconst error = require('koa-json-error')\n\nfunction formatError(err) {\n    return {\n        // Copy some attributes from\n        // the original error\n        status: err.status,\n        message: err.message,\n\n        // ...or add some custom ones\n        success: false,\n        reason: 'Unexpected'\n    }\n}\n\nlet app = new Koa();\napp.use(error(formatError));\n```\n\nThis basic configuration is essentially the same (and serves as a shorthand for) the following:\n\n```js\n'use strict';\nlet app = new Koa();\napp.use(error({\n    preFormat: null,\n    format: formatError\n}));\n```\n\nSee section below.\n\n### Advanced usage\nYou can also customize errors on responses through a series of _three formatter functions_, specified in an `options` object. They receive the raw error object and return a formatted response. This gives you fine-grained control over the final output and allows for different formats on various environments.\n\nYou may pass in the `options` object as argument to the middleware. These are the available settings.\n\n#### `options.preFormat (Function)`\nPerform some task before calling `options.format`. Must be a function with the original `err` as its only argument.\n\nDefaults to:\n\n```js\n(err) => Object.assign({}, err)\n```\n\nWhich sets all enumerable properties of `err` onto the formatted object.\n\n#### `options.format (Function)`\nRuns inmediatly after `options.preFormat`. It receives two arguments: the original `err` and the output of `options.preFormat`. It should `return` a newly formatted error.\n\nDefaults to adding the following non-enumerable properties to the output:\n\n```js\nconst DEFAULT_PROPERTIES = [\n  'name',\n  'message',\n  'stack',\n  'type'\n];\n```\n\nIt also defines a `status` property like so:\n\n```js\nobj.status = err.status || err.statusCode || 500;\n```\n\n#### `options.postFormat (Function)`\nRuns inmediatly after `options.format`. It receives two arguments: the original `err` and the output of `options.format`. It should `return` a newly formatted error.\n\nThe default is a no-op (final output is defined by `options.format`).\n\nThis option is useful when you want to preserve the default functionality and extend it in some way.\n\nFor example,\n```js\n'use strict';\nconst _ = require('lodash');\nconst koa = require('koa');\nconst error = require('koa-json-error')\n\nlet options = {\n    // Avoid showing the stacktrace in 'production' env\n    postFormat: (e, obj) => process.env.NODE_ENV === 'production' ? _.omit(obj, 'stack') : obj\n};\nlet app = new Koa();\napp.use(error(options));\n```\n\n> Modifying the error inside the `*format` functions will mutate the original object. Be aware of that if any other Koa middleware runs after this one.\n\n[npm-image]: https://img.shields.io/npm/v/koa-json-error.svg?style=flat-square\n[npm-url]: https://npmjs.org/package/koa-json-error\n[travis-image]: https://img.shields.io/travis/koajs/json-error/master.svg?style=flat-square\n[travis-url]: https://travis-ci.org/koajs/json-error\n[codecov-image]: https://img.shields.io/codecov/c/github/koajs/json-error/master.svg?style=flat-square\n[codecov-url]: https://codecov.io/github/koajs/json-error\n[david-image]: http://img.shields.io/david/koajs/json-error.svg?style=flat-square\n[david-url]: https://david-dm.org/koajs/json-error\n[license-image]: http://img.shields.io/npm/l/koa-json-error.svg?style=flat-square\n[license-url]: LICENSE\n[downloads-image]: http://img.shields.io/npm/dm/koa-json-error.svg?style=flat-square\n[downloads-url]: https://npmjs.org/package/koa-json-error\n[koa-requirements]: https://github.com/koajs/koa/blob/master/package.json#L61\n\n","maintainers":[{"email":"haoxinst@gmail.com","name":"coderhaoxin"},{"email":"jonathanrichardong@gmail.com","name":"jongleberry"},{"email":"nfantone@gmail.com","name":"nfantone"}],"time":{"modified":"2022-06-19T09:18:37.485Z","created":"2014-04-30T10:06:02.234Z","1.0.0":"2014-04-30T10:06:02.234Z","1.0.1":"2014-05-01T07:06:30.824Z","2.0.0":"2016-04-10T20:05:24.586Z","3.0.0-dev":"2016-04-10T21:05:08.917Z","3.0.0":"2016-04-10T23:28:56.079Z","3.0.1":"2016-07-22T18:25:36.573Z","3.0.2":"2016-10-06T16:20:09.481Z","3.1.0":"2016-10-07T17:14:06.695Z","3.1.1":"2017-03-21T13:28:00.970Z","3.1.2":"2017-03-21T13:48:21.850Z"},"homepage":"https://github.com/koajs/json-error#readme","repository":{"type":"git","url":"git+https://github.com/koajs/json-error.git"},"author":{"name":"Nicolás Fantone","email":"nfantone@gmail.com","url":"https://github.com/nfantone"},"bugs":{"url":"https://github.com/koajs/json-error/issues"},"license":"MIT","readmeFilename":"README.md","keywords":["koa","json","error","api","handler","middleware"],"contributors":[{"name":"Jonathan Ong","email":"me@jongleberry.com","url":"http://jongleberry.com"}],"users":{"oleg_tsyba":true,"itonyyo":true,"gzg1500521074":true,"snowdream":true}}