{"_id":"trough","_rev":"3275358","name":"trough","description":"`trough` is middleware","dist-tags":{"latest":"2.2.0"},"maintainers":[{"name":"wooorm","email":"tituswormer@gmail.com"}],"time":{"modified":"2024-03-21T10:23:30.000Z","created":"2016-08-01T15:37:21.468Z","2.2.0":"2024-02-05T15:27:09.053Z","2.1.0":"2022-02-21T10:48:27.931Z","2.0.2":"2021-07-04T12:08:31.025Z","2.0.1":"2021-06-25T15:11:06.384Z","2.0.0":"2021-05-11T07:43:32.693Z","1.0.5":"2020-01-25T09:40:04.207Z","1.0.4":"2019-05-14T09:11:21.726Z","1.0.3":"2018-08-05T20:22:42.926Z","1.0.2":"2018-04-15T19:25:06.523Z","1.0.1":"2017-07-09T10:02:42.292Z","1.0.0":"2016-08-01T15:37:21.468Z"},"users":{"daizch":true},"author":{"name":"Titus Wormer","email":"tituswormer@gmail.com","url":"https://wooorm.com"},"repository":{"type":"git","url":"git+https://github.com/wooorm/trough.git"},"versions":{"2.2.0":{"name":"trough","version":"2.2.0","description":"`trough` is middleware","license":"MIT","keywords":["middleware","ware"],"repository":{"type":"git","url":"git+https://github.com/wooorm/trough.git"},"bugs":{"url":"https://github.com/wooorm/trough/issues"},"funding":{"type":"github","url":"https://github.com/sponsors/wooorm"},"author":{"name":"Titus Wormer","email":"tituswormer@gmail.com","url":"https://wooorm.com"},"contributors":[{"name":"Titus Wormer","email":"tituswormer@gmail.com","url":"https://wooorm.com"}],"sideEffects":false,"type":"module","exports":"./index.js","devDependencies":{"@types/node":"^20.0.0","c8":"^9.0.0","prettier":"^3.0.0","remark-cli":"^11.0.0","remark-preset-wooorm":"^9.0.0","type-coverage":"^2.0.0","typescript":"^5.0.0","xo":"^0.56.0"},"scripts":{"build":"tsc --build --clean && tsc --build && type-coverage","format":"remark . --frail --output --quiet && prettier . --log-level warn --write && xo --fix","prepack":"npm run build && npm run format","test":"npm run build && npm run format && npm run test-coverage","test-api":"node --conditions development test.js","test-coverage":"c8 --100 --reporter lcov npm run test-api"},"prettier":{"bracketSpacing":false,"singleQuote":true,"semi":false,"tabWidth":2,"trailingComma":"none","useTabs":false},"remarkConfig":{"plugins":["remark-preset-wooorm"]},"typeCoverage":{"atLeast":100,"detail":true,"strict":true,"ignoreCatch":true,"#":"some nessecary `any`s","ignoreFiles":["lib/index.js","lib/index.d.ts"]},"xo":{"prettier":true,"rules":{"capitalized-comments":"off"}},"_id":"trough@2.2.0","gitHead":"f5b7dbf722a7df379d0247a6ab07bd41d0db376d","types":"./index.d.ts","homepage":"https://github.com/wooorm/trough#readme","_nodeVersion":"21.2.0","_npmVersion":"10.2.3","dist":{"shasum":"94a60bd6bd375c152c1df911a4b11d5b0256f50f","size":6776,"noattachment":false,"key":"/trough/-/trough-2.2.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/trough/download/trough-2.2.0.tgz"},"_npmUser":{"name":"wooorm","email":"tituswormer@gmail.com"},"directories":{},"maintainers":[{"name":"wooorm","email":"tituswormer@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/trough_2.2.0_1707146828886_0.1509866014637491"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2024-02-05T15:27:09.053Z","publish_time":1707146829053,"_source_registry_name":"default","_cnpm_publish_time":1707146829053},"2.1.0":{"name":"trough","version":"2.1.0","description":"Middleware: a channel used to convey a liquid","license":"MIT","keywords":["middleware","ware"],"repository":{"type":"git","url":"git+https://github.com/wooorm/trough.git"},"bugs":{"url":"https://github.com/wooorm/trough/issues"},"funding":{"type":"github","url":"https://github.com/sponsors/wooorm"},"author":{"name":"Titus Wormer","email":"tituswormer@gmail.com","url":"https://wooorm.com"},"contributors":[{"name":"Titus Wormer","email":"tituswormer@gmail.com","url":"https://wooorm.com"}],"sideEffects":false,"type":"module","main":"index.js","types":"index.d.ts","devDependencies":{"@types/tape":"^4.0.0","c8":"^7.0.0","prettier":"^2.0.0","remark-cli":"^10.0.0","remark-preset-wooorm":"^9.0.0","rimraf":"^3.0.0","tape":"^5.0.0","type-coverage":"^2.0.0","typescript":"^4.0.0","xo":"^0.48.0"},"scripts":{"prepack":"npm run build && npm run format","build":"rimraf \"*.d.ts\" && tsc && type-coverage","format":"remark . -qfo && prettier . -w --loglevel warn && xo --fix","test-api":"node test.js","test-coverage":"c8 --check-coverage --branches 100 --functions 100 --lines 100 --statements 100 --reporter lcov node test.js","test":"npm run build && npm run format && npm run test-coverage"},"prettier":{"tabWidth":2,"useTabs":false,"singleQuote":true,"bracketSpacing":false,"semi":false,"trailingComma":"none"},"xo":{"prettier":true,"rules":{"capitalized-comments":"off"}},"remarkConfig":{"plugins":["preset-wooorm"]},"typeCoverage":{"atLeast":100,"detail":true,"strict":true,"ignoreCatch":true,"#":"some nessecary `any`s","ignoreFiles":["index.js","index.d.ts"]},"gitHead":"0b392bf2ed11dba640dac9298a74b086f4bd699c","homepage":"https://github.com/wooorm/trough#readme","_id":"trough@2.1.0","_nodeVersion":"17.4.0","_npmVersion":"8.4.1","dist":{"shasum":"0f7b511a4fde65a46f18477ab38849b22c554876","size":5800,"noattachment":false,"key":"/trough/-/trough-2.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/trough/download/trough-2.1.0.tgz"},"_npmUser":{"name":"wooorm","email":"tituswormer@gmail.com"},"directories":{},"maintainers":[{"name":"wooorm","email":"tituswormer@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/trough_2.1.0_1645440507792_0.4183219167366208"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2022-02-21T10:48:32.731Z","publish_time":1645440507931,"_cnpm_publish_time":1645440507931},"2.0.2":{"name":"trough","version":"2.0.2","description":"Middleware: a channel used to convey a liquid","license":"MIT","keywords":["middleware","ware"],"repository":{"type":"git","url":"git+https://github.com/wooorm/trough.git"},"bugs":{"url":"https://github.com/wooorm/trough/issues"},"funding":{"type":"github","url":"https://github.com/sponsors/wooorm"},"author":{"name":"Titus Wormer","email":"tituswormer@gmail.com","url":"https://wooorm.com"},"contributors":[{"name":"Titus Wormer","email":"tituswormer@gmail.com","url":"https://wooorm.com"}],"sideEffects":false,"type":"module","main":"index.js","types":"index.d.ts","devDependencies":{"@types/tape":"^4.0.0","c8":"^7.0.0","prettier":"^2.0.0","remark-cli":"^9.0.0","remark-preset-wooorm":"^8.0.0","rimraf":"^3.0.0","tape":"^5.0.0","type-coverage":"^2.0.0","typescript":"^4.0.0","xo":"^0.39.0"},"scripts":{"prepack":"npm run build && npm run format","build":"rimraf \"*.d.ts\" && tsc && type-coverage","format":"remark . -qfo && prettier . -w --loglevel warn && xo --fix","test-api":"node test.js","test-coverage":"c8 --check-coverage --branches 100 --functions 100 --lines 100 --statements 100 --reporter lcov node test.js","test":"npm run build && npm run format && npm run test-coverage"},"prettier":{"tabWidth":2,"useTabs":false,"singleQuote":true,"bracketSpacing":false,"semi":false,"trailingComma":"none"},"xo":{"prettier":true,"rules":{"capitalized-comments":"off"}},"remarkConfig":{"plugins":["preset-wooorm"]},"typeCoverage":{"atLeast":100,"detail":true,"strict":true,"ignoreCatch":true,"#":"some nessecary `any`s","ignoreFiles":["index.js","index.d.ts"]},"gitHead":"09e47dc13e0f4d1dcae6e13062bd5bffd9caa449","homepage":"https://github.com/wooorm/trough#readme","_id":"trough@2.0.2","_nodeVersion":"16.2.0","_npmVersion":"7.18.1","dist":{"shasum":"94a3aa9d5ce379fc561f6244905b3f36b7458d96","size":5179,"noattachment":false,"key":"/trough/-/trough-2.0.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/trough/download/trough-2.0.2.tgz"},"_npmUser":{"name":"wooorm","email":"tituswormer@gmail.com"},"directories":{},"maintainers":[{"name":"wooorm","email":"tituswormer@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/trough_2.0.2_1625400510903_0.4769739188287889"},"_hasShrinkwrap":false,"publish_time":1625400511025,"_cnpm_publish_time":1625400511025},"2.0.1":{"name":"trough","version":"2.0.1","description":"Middleware: a channel used to convey a liquid","license":"MIT","keywords":["middleware","ware"],"repository":{"type":"git","url":"git+https://github.com/wooorm/trough.git"},"bugs":{"url":"https://github.com/wooorm/trough/issues"},"funding":{"type":"github","url":"https://github.com/sponsors/wooorm"},"author":{"name":"Titus Wormer","email":"tituswormer@gmail.com","url":"https://wooorm.com"},"contributors":[{"name":"Titus Wormer","email":"tituswormer@gmail.com","url":"https://wooorm.com"}],"sideEffects":false,"type":"module","main":"index.js","types":"index.d.ts","devDependencies":{"@types/tape":"^4.0.0","c8":"^7.0.0","prettier":"^2.0.0","remark-cli":"^9.0.0","remark-preset-wooorm":"^8.0.0","rimraf":"^3.0.0","tape":"^5.0.0","type-coverage":"^2.0.0","typescript":"^4.0.0","xo":"^0.39.0"},"scripts":{"prepack":"npm run build && npm run format","build":"rimraf \"*.d.ts\" && tsc && type-coverage","format":"remark . -qfo && prettier . -w --loglevel warn && xo --fix","test-api":"node test.js","test-coverage":"c8 --check-coverage --branches 100 --functions 100 --lines 100 --statements 100 --reporter lcov node test.js","test":"npm run build && npm run format && npm run test-coverage"},"prettier":{"tabWidth":2,"useTabs":false,"singleQuote":true,"bracketSpacing":false,"semi":false,"trailingComma":"none"},"xo":{"prettier":true,"rules":{"capitalized-comments":"off"}},"remarkConfig":{"plugins":["preset-wooorm"]},"typeCoverage":{"atLeast":100,"detail":true,"strict":true,"ignoreCatch":true},"gitHead":"15729533f6d97c9857a76bac4375c15df0fee7f2","homepage":"https://github.com/wooorm/trough#readme","_id":"trough@2.0.1","_nodeVersion":"16.2.0","_npmVersion":"7.18.1","dist":{"shasum":"1146715df4c4e5d96003610041bcec4ad809854b","size":5198,"noattachment":false,"key":"/trough/-/trough-2.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/trough/download/trough-2.0.1.tgz"},"_npmUser":{"name":"wooorm","email":"tituswormer@gmail.com"},"directories":{},"maintainers":[{"name":"wooorm","email":"tituswormer@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/trough_2.0.1_1624633866258_0.4903132428330683"},"_hasShrinkwrap":false,"publish_time":1624633866384,"_cnpm_publish_time":1624633866384},"2.0.0":{"name":"trough","version":"2.0.0","description":"Middleware: a channel used to convey a liquid","license":"MIT","keywords":["middleware","ware"],"repository":{"type":"git","url":"git+https://github.com/wooorm/trough.git"},"bugs":{"url":"https://github.com/wooorm/trough/issues"},"funding":{"type":"github","url":"https://github.com/sponsors/wooorm"},"author":{"name":"Titus Wormer","email":"tituswormer@gmail.com","url":"https://wooorm.com"},"contributors":[{"name":"Titus Wormer","email":"tituswormer@gmail.com","url":"https://wooorm.com"}],"sideEffects":false,"type":"module","main":"index.js","types":"index.d.ts","devDependencies":{"@types/tape":"^4.0.0","c8":"^7.0.0","prettier":"^2.0.0","remark-cli":"^9.0.0","remark-preset-wooorm":"^8.0.0","rimraf":"^3.0.0","tape":"^5.0.0","type-coverage":"^2.0.0","typescript":"^4.0.0","xo":"^0.38.0"},"scripts":{"prepack":"npm run build && npm run format","build":"rimraf \"*.d.ts\" && tsc && type-coverage","format":"remark . -qfo && prettier . -w --loglevel warn && xo --fix","test-api":"node test.js","test-coverage":"c8 --check-coverage --branches 100 --functions 100 --lines 100 --statements 100 --reporter lcov node test.js","test":"npm run build && npm run format && npm run test-coverage"},"prettier":{"tabWidth":2,"useTabs":false,"singleQuote":true,"bracketSpacing":false,"semi":false,"trailingComma":"none"},"xo":{"prettier":true,"rules":{"capitalized-comments":"off","no-var":"off","prefer-arrow-callback":"off"}},"remarkConfig":{"plugins":["preset-wooorm"]},"typeCoverage":{"atLeast":100,"detail":true,"strict":true,"ignoreCatch":true},"gitHead":"c84b752128be6281f50a6e36c0472788546c37a1","homepage":"https://github.com/wooorm/trough#readme","_id":"trough@2.0.0","_nodeVersion":"15.11.0","_npmVersion":"7.11.1","dist":{"shasum":"206b18ee20661b857dc44589e01666740cfddf81","size":5191,"noattachment":false,"key":"/trough/-/trough-2.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/trough/download/trough-2.0.0.tgz"},"_npmUser":{"name":"wooorm","email":"tituswormer@gmail.com"},"directories":{},"maintainers":[{"name":"wooorm","email":"tituswormer@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/trough_2.0.0_1620719012535_0.3424384330897017"},"_hasShrinkwrap":false,"publish_time":1620719012693,"_cnpm_publish_time":1620719012693},"1.0.5":{"name":"trough","version":"1.0.5","description":"Middleware: a channel used to convey a liquid","license":"MIT","keywords":["middleware","ware"],"repository":{"type":"git","url":"git+https://github.com/wooorm/trough.git"},"bugs":{"url":"https://github.com/wooorm/trough/issues"},"funding":{"type":"github","url":"https://github.com/sponsors/wooorm"},"author":{"name":"Titus Wormer","email":"tituswormer@gmail.com","url":"https://wooorm.com"},"contributors":[{"name":"Titus Wormer","email":"tituswormer@gmail.com","url":"https://wooorm.com"}],"dependencies":{},"devDependencies":{"browserify":"^16.0.0","nyc":"^15.0.0","prettier":"^1.0.0","remark-cli":"^7.0.0","remark-preset-wooorm":"^6.0.0","tape":"^4.0.0","tinyify":"^2.0.0","xo":"^0.25.0"},"scripts":{"format":"remark . -qfo && prettier --write \"**/*.js\" && xo --fix","build-bundle":"browserify index.js -s trough > trough.js","build-mangle":"browserify index.js -s trough -p tinyify > trough.min.js","build":"npm run build-bundle && npm run build-mangle","test-api":"node test","test-coverage":"nyc --reporter lcov tape test.js","test":"npm run format && npm run build && npm run test-coverage"},"prettier":{"tabWidth":2,"useTabs":false,"singleQuote":true,"bracketSpacing":false,"semi":false,"trailingComma":"none"},"xo":{"prettier":true,"esnext":false,"rules":{"unicorn/prefer-reflect-apply":"off","unicorn/prefer-type-error":"off","guard-for-in":"off"},"ignores":["trough.js"]},"remarkConfig":{"plugins":["preset-wooorm"]},"nyc":{"check-coverage":true,"lines":100,"functions":100,"branches":100},"gitHead":"1e1ccc351816677c62202bd66aa385a572eafa1a","homepage":"https://github.com/wooorm/trough#readme","_id":"trough@1.0.5","_nodeVersion":"13.0.1","_npmVersion":"6.13.6","dist":{"shasum":"b8b639cefad7d0bb2abd37d433ff8293efa5f406","size":4844,"noattachment":false,"key":"/trough/-/trough-1.0.5.tgz","tarball":"http://registry.cnpm.dingdandao.com/trough/download/trough-1.0.5.tgz"},"maintainers":[{"name":"wooorm","email":"tituswormer@gmail.com"}],"_npmUser":{"name":"wooorm","email":"tituswormer@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/trough_1.0.5_1579945204047_0.43205000711550223"},"_hasShrinkwrap":false,"publish_time":1579945204207,"_cnpm_publish_time":1579945204207},"1.0.4":{"name":"trough","version":"1.0.4","description":"Middleware: a channel used to convey a liquid","license":"MIT","keywords":["middleware","ware"],"repository":{"type":"git","url":"git+https://github.com/wooorm/trough.git"},"bugs":{"url":"https://github.com/wooorm/trough/issues"},"author":{"name":"Titus Wormer","email":"tituswormer@gmail.com","url":"https://wooorm.com"},"contributors":[{"name":"Titus Wormer","email":"tituswormer@gmail.com","url":"https://wooorm.com"}],"dependencies":{},"devDependencies":{"browserify":"^16.0.0","nyc":"^14.0.0","prettier":"^1.12.0","remark-cli":"^6.0.0","remark-preset-wooorm":"^4.0.0","tape":"^4.4.0","tinyify":"^2.4.3","xo":"^0.24.0"},"scripts":{"format":"remark . -qfo && prettier --write \"**/*.js\" && xo --fix","build-bundle":"browserify index.js -s trough > trough.js","build-mangle":"browserify index.js -s trough -p tinyify > trough.min.js","build":"npm run build-bundle && npm run build-mangle","test-api":"node test","test-coverage":"nyc --reporter lcov tape test.js","test":"npm run format && npm run build && npm run test-coverage"},"prettier":{"tabWidth":2,"useTabs":false,"singleQuote":true,"bracketSpacing":false,"semi":false,"trailingComma":"none"},"xo":{"prettier":true,"esnext":false,"rules":{"guard-for-in":"off","unicorn/prefer-type-error":"off"},"ignores":["trough.js"]},"remarkConfig":{"plugins":["preset-wooorm"]},"nyc":{"check-coverage":true,"lines":100,"functions":100,"branches":100},"gitHead":"663811420b859bfbf9653d7d02d0d26e62aaee6d","homepage":"https://github.com/wooorm/trough#readme","_id":"trough@1.0.4","_nodeVersion":"11.9.0","_npmVersion":"6.9.0","dist":{"shasum":"3b52b1f13924f460c3fbfd0df69b587dbcbc762e","size":4827,"noattachment":false,"key":"/trough/-/trough-1.0.4.tgz","tarball":"http://registry.cnpm.dingdandao.com/trough/download/trough-1.0.4.tgz"},"maintainers":[{"name":"wooorm","email":"tituswormer@gmail.com"}],"_npmUser":{"name":"wooorm","email":"tituswormer@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/trough_1.0.4_1557825081403_0.1279159862776782"},"_hasShrinkwrap":false,"publish_time":1557825081726,"_cnpm_publish_time":1557825081726},"1.0.3":{"name":"trough","version":"1.0.3","description":"Middleware: a channel used to convey a liquid","license":"MIT","keywords":["middleware","ware"],"repository":{"type":"git","url":"git+https://github.com/wooorm/trough.git"},"bugs":{"url":"https://github.com/wooorm/trough/issues"},"author":{"name":"Titus Wormer","email":"tituswormer@gmail.com","url":"http://wooorm.com"},"contributors":[{"name":"Titus Wormer","email":"tituswormer@gmail.com","url":"http://wooorm.com"}],"files":["index.js","wrap.js"],"dependencies":{},"devDependencies":{"browserify":"^16.0.0","nyc":"^11.0.0","prettier":"^1.12.0","remark-cli":"^5.0.0","remark-preset-wooorm":"^4.0.0","tape":"^4.4.0","tinyify":"^2.4.3","xo":"^0.20.0"},"scripts":{"format":"remark . -qfo && prettier --write '**/*.js' && xo --fix","build-bundle":"browserify index.js -s trough > trough.js","build-mangle":"browserify index.js -s trough -p tinyify > trough.min.js","build":"npm run build-bundle && npm run build-mangle","test-api":"node test","test-coverage":"nyc --reporter lcov tape test.js","test":"npm run format && npm run build && npm run test-coverage"},"prettier":{"tabWidth":2,"useTabs":false,"singleQuote":true,"bracketSpacing":false,"semi":false,"trailingComma":"none"},"xo":{"prettier":true,"esnext":false,"rules":{"guard-for-in":"off","unicorn/prefer-type-error":"off","no-var":"off","prefer-arrow-callback":"off"},"ignores":["trough.js"]},"remarkConfig":{"plugins":["preset-wooorm"]},"nyc":{"check-coverage":true,"lines":100,"functions":100,"branches":100},"gitHead":"3aa804aa9e1b070c12aff2ee68b4e8eebaf33e1b","homepage":"https://github.com/wooorm/trough#readme","_id":"trough@1.0.3","_npmVersion":"6.3.0","_nodeVersion":"10.0.0","_npmUser":{"name":"wooorm","email":"tituswormer@gmail.com"},"dist":{"shasum":"e29bd1614c6458d44869fc28b255ab7857ef7c24","size":4768,"noattachment":false,"key":"/trough/-/trough-1.0.3.tgz","tarball":"http://registry.cnpm.dingdandao.com/trough/download/trough-1.0.3.tgz"},"maintainers":[{"name":"wooorm","email":"tituswormer@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/trough_1.0.3_1533500562861_0.1501738347718511"},"_hasShrinkwrap":false,"publish_time":1533500562926,"_cnpm_publish_time":1533500562926},"1.0.2":{"name":"trough","version":"1.0.2","description":"Middleware: a channel used to convey a liquid","license":"MIT","keywords":["middleware","ware"],"repository":{"type":"git","url":"git+https://github.com/wooorm/trough.git"},"bugs":{"url":"https://github.com/wooorm/trough/issues"},"author":{"name":"Titus Wormer","email":"tituswormer@gmail.com","url":"http://wooorm.com"},"contributors":[{"name":"Titus Wormer","email":"tituswormer@gmail.com","url":"http://wooorm.com"}],"files":["index.js"],"dependencies":{},"devDependencies":{"browserify":"^16.0.0","esmangle":"^1.0.0","nyc":"^11.0.0","prettier":"^1.12.0","remark-cli":"^5.0.0","remark-preset-wooorm":"^4.0.0","tape":"^4.4.0","xo":"^0.20.0"},"scripts":{"format":"remark . -qfo && prettier --write '**/*.js' && xo --fix","build-bundle":"browserify index.js -s trough > trough.js","build-mangle":"esmangle trough.js > trough.min.js","build":"npm run build-bundle && npm run build-mangle","test-api":"node test","test-coverage":"nyc --reporter lcov tape test.js","test":"npm run format && npm run build && npm run test-coverage"},"prettier":{"tabWidth":2,"useTabs":false,"singleQuote":true,"bracketSpacing":false,"semi":false,"trailingComma":"none"},"xo":{"prettier":true,"esnext":false,"rules":{"guard-for-in":"off","unicorn/prefer-type-error":"off","no-var":"off","prefer-arrow-callback":"off"},"ignores":["trough.js"]},"remarkConfig":{"plugins":["preset-wooorm"]},"nyc":{"check-coverage":true,"lines":100,"functions":100,"branches":100},"gitHead":"b0935085712558b7497721a4a4da977bd65be80d","homepage":"https://github.com/wooorm/trough#readme","_id":"trough@1.0.2","_npmVersion":"5.6.0","_nodeVersion":"9.5.0","_npmUser":{"name":"wooorm","email":"tituswormer@gmail.com"},"dist":{"shasum":"7f1663ec55c480139e2de5e486c6aef6cc24a535","size":4456,"noattachment":false,"key":"/trough/-/trough-1.0.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/trough/download/trough-1.0.2.tgz"},"maintainers":[{"name":"wooorm","email":"tituswormer@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/trough_1.0.2_1523820305253_0.8164597630291217"},"_hasShrinkwrap":false,"publish_time":1523820306523,"_cnpm_publish_time":1523820306523},"1.0.1":{"name":"trough","version":"1.0.1","description":"Middleware: a channel used to convey a liquid","license":"MIT","keywords":["middleware","ware"],"repository":{"type":"git","url":"git+https://github.com/wooorm/trough.git"},"bugs":{"url":"https://github.com/wooorm/trough/issues"},"author":{"name":"Titus Wormer","email":"tituswormer@gmail.com","url":"http://wooorm.com"},"contributors":[{"name":"Titus Wormer","email":"tituswormer@gmail.com","url":"http://wooorm.com"}],"files":["index.js"],"dependencies":{},"devDependencies":{"browserify":"^14.1.0","esmangle":"^1.0.0","nyc":"^11.0.0","remark-cli":"^3.0.0","remark-preset-wooorm":"^3.0.0","tape":"^4.4.0","xo":"^0.18.0"},"scripts":{"build-md":"remark . -qfo","build-bundle":"browserify index.js -s trough > trough.js","build-mangle":"esmangle trough.js > trough.min.js","build":"npm run build-md && npm run build-bundle && npm run build-mangle","lint":"xo","test-api":"node test","test-coverage":"nyc --reporter lcov tape test.js","test":"npm run build && npm run lint && npm run test-coverage"},"nyc":{"check-coverage":true,"lines":100,"functions":100,"branches":100},"xo":{"space":true,"esnext":false,"rules":{"guard-for-in":"off","unicorn/prefer-type-error":"off"},"ignores":["trough.js"]},"remarkConfig":{"plugins":["preset-wooorm"]},"gitHead":"5980e8f9091ba499b894014476414cfe258404c7","homepage":"https://github.com/wooorm/trough#readme","_id":"trough@1.0.1","_shasum":"a9fd8b0394b0ae8fff82e0633a0a36ccad5b5f86","_from":".","_npmVersion":"2.14.2","_nodeVersion":"4.0.0","_npmUser":{"name":"wooorm","email":"tituswormer@gmail.com"},"dist":{"shasum":"a9fd8b0394b0ae8fff82e0633a0a36ccad5b5f86","size":4359,"noattachment":false,"key":"/trough/-/trough-1.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/trough/download/trough-1.0.1.tgz"},"maintainers":[{"name":"wooorm","email":"tituswormer@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/trough-1.0.1.tgz_1499594561072_0.2403400642797351"},"directories":{},"publish_time":1499594562292,"_cnpm_publish_time":1499594562292,"_hasShrinkwrap":false},"1.0.0":{"name":"trough","version":"1.0.0","description":"Middleware: a channel used to convey a liquid","license":"MIT","keywords":["middleware","ware"],"dependencies":{},"repository":{"type":"git","url":"git+https://github.com/wooorm/trough.git"},"bugs":{"url":"https://github.com/wooorm/trough/issues"},"author":{"name":"Titus Wormer","email":"tituswormer@gmail.com","url":"http://wooorm.com"},"contributors":[{"name":"Titus Wormer","email":"tituswormer@gmail.com","url":"http://wooorm.com"}],"engines":{"node":">=0.11.0"},"files":["index.js"],"devDependencies":{"browserify":"^13.0.0","esmangle":"^1.0.0","nyc":"^7.1.0","remark-cli":"^1.0.0","remark-comment-config":"^4.0.0","remark-github":"^5.0.0","remark-lint":"^4.0.0","remark-toc":"^3.0.0","remark-validate-links":"^4.0.0","tape":"^4.4.0","xo":"^0.16.0"},"scripts":{"build-md":"remark . --quiet --frail","build-bundle":"browserify index.js -s trough > trough.js","build-mangle":"esmangle trough.js > trough.min.js","build":"npm run build-md && npm run build-bundle && npm run build-mangle","lint":"xo","test-api":"node test","test-coverage":"nyc --reporter lcov tape test.js","test":"npm run build && npm run lint && npm run test-coverage"},"nyc":{"check-coverage":true,"lines":100,"functions":100,"branches":100},"xo":{"space":true,"rules":{"guard-for-in":"off","max-lines":"off"},"ignores":["trough.js","trough.min.js"]},"remarkConfig":{"output":true,"plugins":{"comment-config":null,"lint":{"heading-increment":false,"no-duplicate-headings":false,"list-item-spacing":false},"github":null,"toc":{"tight":true,"maxDepth":3},"validate-links":null},"settings":{"bullet":"*"}},"gitHead":"78f9debf5f756e2b18ce9ff70db4f2907896e3a8","homepage":"https://github.com/wooorm/trough#readme","_id":"trough@1.0.0","_shasum":"6bdedfe7f2aa49a6f3c432257687555957f342fd","_from":".","_npmVersion":"3.3.6","_nodeVersion":"5.0.0","_npmUser":{"name":"wooorm","email":"tituswormer@gmail.com"},"dist":{"shasum":"6bdedfe7f2aa49a6f3c432257687555957f342fd","size":4851,"noattachment":false,"key":"/trough/-/trough-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/trough/download/trough-1.0.0.tgz"},"maintainers":[{"name":"wooorm","email":"tituswormer@gmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/trough-1.0.0.tgz_1470065839549_0.26185039919801056"},"directories":{},"publish_time":1470065841468,"_cnpm_publish_time":1470065841468,"_hasShrinkwrap":false}},"readme":"# trough\n\n[![Build][badge-build-image]][badge-build-url]\n[![Coverage][badge-coverage-image]][badge-coverage-url]\n[![Downloads][badge-downloads-image]][badge-downloads-url]\n[![Size][badge-size-image]][badge-size-url]\n\n`trough` is middleware.\n\n## Contents\n\n*   [What is this?](#what-is-this)\n*   [When should I use this?](#when-should-i-use-this)\n*   [Install](#install)\n*   [Use](#use)\n*   [API](#api)\n    *   [`trough()`](#trough-1)\n    *   [`wrap(middleware, callback)`](#wrapmiddleware-callback)\n    *   [`Callback`](#callback)\n    *   [`Middleware`](#middleware)\n    *   [`Pipeline`](#pipeline)\n    *   [`Run`](#run)\n    *   [`Use`](#use-1)\n*   [Compatibility](#compatibility)\n*   [Security](#security)\n*   [Contribute](#contribute)\n*   [License](#license)\n\n## What is this?\n\n`trough` is like [`ware`][github-segmentio-ware] with less sugar.\nMiddleware functions can also change the input of the next.\n\nThe word **trough** (`/trôf/`) means a channel used to convey a liquid.\n\n## When should I use this?\n\nYou can use this package when you’re building something that accepts “plugins”,\nwhich are functions, that can be sync or async, promises or callbacks.\n\n## Install\n\nThis package is [ESM only][github-gist-esm].\nIn Node.js (version 16+),\ninstall with [npm][npm-install]:\n\n```sh\nnpm install trough\n```\n\nIn Deno with [`esm.sh`][esm-sh]:\n\n```js\nimport {trough, wrap} from 'https://esm.sh/trough@2'\n```\n\nIn browsers with [`esm.sh`][esm-sh]:\n\n```html\n<script type=\"module\">\n  import {trough, wrap} from 'https://esm.sh/trough@2?bundle'\n</script>\n```\n\n## Use\n\n```js\nimport fs from 'node:fs'\nimport path from 'node:path'\nimport process from 'node:process'\nimport {trough} from 'trough'\n\nconst pipeline = trough()\n  .use(function (fileName) {\n    console.log('Checking… ' + fileName)\n  })\n  .use(function (fileName) {\n    return path.join(process.cwd(), fileName)\n  })\n  .use(function (filePath, next) {\n    fs.stat(filePath, function (error, stats) {\n      next(error, {filePath, stats})\n    })\n  })\n  .use(function (ctx, next) {\n    if (ctx.stats.isFile()) {\n      fs.readFile(ctx.filePath, next)\n    } else {\n      next(new Error('Expected file'))\n    }\n  })\n\npipeline.run('readme.md', console.log)\npipeline.run('node_modules', console.log)\n```\n\nYields:\n\n```txt\nChecking… readme.md\nChecking… node_modules\nError: Expected file\n    at ~/example.js:22:12\n    at wrapped (~/node_modules/trough/index.js:111:16)\n    at next (~/node_modules/trough/index.js:62:23)\n    at done (~/node_modules/trough/index.js:145:7)\n    at ~/example.js:15:7\n    at FSReqCallback.oncomplete (node:fs:199:5)\nnull <Buffer 23 20 74 72 6f 75 67 68 0a 0a 5b 21 5b 42 75 69 6c 64 5d 5b 62 75 69 6c 64 2d 62 61 64 67 65 5d 5d 5b 62 75 69 6c 64 5d 0a 5b 21 5b 43 6f 76 65 72 61 ... 7994 more bytes>\n```\n\n## API\n\nThis package exports the identifiers\n[`trough`][api-trough] and\n[`wrap`][api-wrap].\nThere is no default export.\n\nIt exports the [TypeScript][] types\n[`Callback`][api-callback],\n[`Middleware`][api-middleware],\n[`Pipeline`][api-pipeline],\n[`Run`][api-run],\nand [`Use`][api-use].\n\n### `trough()`\n\nCreate new middleware.\n\n###### Parameters\n\nThere are no parameters.\n\n###### Returns\n\n[`Pipeline`][api-pipeline].\n\n### `wrap(middleware, callback)`\n\nWrap `middleware` into a uniform interface.\n\nYou can pass all input to the resulting function.\n`callback` is then called with the output of `middleware`.\n\nIf `middleware` accepts more arguments than the later given in input,\nan extra `done` function is passed to it after that input,\nwhich must be called by `middleware`.\n\nThe first value in `input` is the main input value.\nAll other input values are the rest input values.\nThe values given to `callback` are the input values,\nmerged with every non-nullish output value.\n\n*   if `middleware` throws an error,\n    returns a promise that is rejected,\n    or calls the given `done` function with an error,\n    `callback` is called with that error\n*   if `middleware` returns a value or returns a promise that is resolved,\n    that value is the main output value\n*   if `middleware` calls `done`,\n    all non-nullish values except for the first one (the error) overwrite the\n    output values\n\n###### Parameters\n\n*   `middleware` ([`Middleware`][api-middleware])\n    — function to wrap\n*   `callback` ([`Callback`][api-callback])\n    — callback called with the output of `middleware`\n\n###### Returns\n\nWrapped middleware ([`Run`][api-run]).\n\n### `Callback`\n\nCallback function (TypeScript type).\n\n###### Parameters\n\n*   `error` (`Error`, optional)\n    — error, if any\n*   `...output` (`Array<unknown>`, optional)\n    — output values\n\n###### Returns\n\nNothing (`undefined`).\n\n### `Middleware`\n\nA middleware function called with the output of its predecessor (TypeScript\ntype).\n\n###### Synchronous\n\nIf `fn` returns or throws an error,\nthe pipeline fails and `done` is called with that error.\n\nIf `fn` returns a value (neither `null` nor `undefined`),\nthe first `input` of the next function is set to that value\n(all other `input` is passed through).\n\nThe following example shows how returning an error stops the pipeline:\n\n```js\nimport {trough} from 'trough'\n\ntrough()\n  .use(function (thing) {\n    return new Error('Got: ' + thing)\n  })\n  .run('some value', console.log)\n```\n\nYields:\n\n```txt\nError: Got: some value\n    at ~/example.js:5:12\n    …\n```\n\nThe following example shows how throwing an error stops the pipeline:\n\n```js\nimport {trough} from 'trough'\n\ntrough()\n  .use(function (thing) {\n    throw new Error('Got: ' + thing)\n  })\n  .run('more value', console.log)\n```\n\nYields:\n\n```txt\nError: Got: more value\n    at ~/example.js:5:11\n    …\n```\n\nThe following example shows how the first output can be modified:\n\n```js\nimport {trough} from 'trough'\n\ntrough()\n  .use(function (thing) {\n    return 'even ' + thing\n  })\n  .run('more value', 'untouched', console.log)\n```\n\nYields:\n\n```txt\nnull 'even more value' 'untouched'\n```\n\n###### Promise\n\nIf `fn` returns a promise,\nand that promise rejects,\nthe pipeline fails and `done` is called with the rejected value.\n\nIf `fn` returns a promise,\nand that promise resolves with a value (neither `null` nor `undefined`),\nthe first `input` of the next function is set to that value (all other `input`\nis passed through).\n\nThe following example shows how rejecting a promise stops the pipeline:\n\n```js\nimport {trough} from 'trough'\n\ntrough()\n  .use(function (thing) {\n    return new Promise(function (resolve, reject) {\n      reject('Got: ' + thing)\n    })\n  })\n  .run('thing', console.log)\n```\n\nYields:\n\n```txt\nGot: thing\n```\n\nThe following example shows how the input isn’t touched by resolving to `null`.\n\n```js\nimport {trough} from 'trough'\n\ntrough()\n  .use(function () {\n    return new Promise(function (resolve) {\n      setTimeout(function () {\n        resolve(null)\n      }, 100)\n    })\n  })\n  .run('Input', console.log)\n```\n\nYields:\n\n```txt\nnull 'Input'\n```\n\n###### Asynchronous\n\nIf `fn` accepts one more argument than the given `input`,\na `next` function is given (after the input).\n`next` must be called, but doesn’t have to be called async.\n\nIf `next` is given a value (neither `null` nor `undefined`) as its first\nargument,\nthe pipeline fails and `done` is called with that value.\n\nIf `next` is given no value (either `null` or `undefined`) as the first\nargument,\nall following non-nullish values change the input of the following\nfunction,\nand all nullish values default to the `input`.\n\nThe following example shows how passing a first argument stops the pipeline:\n\n```js\nimport {trough} from 'trough'\n\ntrough()\n  .use(function (thing, next) {\n    next(new Error('Got: ' + thing))\n  })\n  .run('thing', console.log)\n```\n\nYields:\n\n```txt\nError: Got: thing\n    at ~/example.js:5:10\n```\n\nThe following example shows how more values than the input are passed.\n\n```js\nimport {trough} from 'trough'\n\ntrough()\n  .use(function (thing, next) {\n    setTimeout(function () {\n      next(null, null, 'values')\n    }, 100)\n  })\n  .run('some', console.log)\n```\n\nYields:\n\n```txt\nnull 'some' 'values'\n```\n\n###### Parameters\n\n*   `...input` (`Array<any>`, optional)\n    — input values\n\n###### Returns\n\nOutput, promise, etc (`any`).\n\n### `Pipeline`\n\nPipeline (TypeScript type).\n\n###### Properties\n\n*   `run` ([`Run`][api-run])\n    — run the pipeline\n*   `use` ([`Use`][api-use])\n    — add middleware\n\n### `Run`\n\nCall all middleware (TypeScript type).\n\nCalls `done` on completion with either an error or the output of the\nlast middleware.\n\n> ???? **Note**: as the length of input defines whether async functions get a\n> `next` function,\n> it’s recommended to keep `input` at one value normally.\n\n###### Parameters\n\n*   `...input` (`Array<any>`, optional)\n    — input values\n*   `done` ([`Callback`][api-callback])\n    — callback called when done\n\n###### Returns\n\nNothing (`undefined`).\n\n### `Use`\n\nAdd middleware (TypeScript type).\n\n###### Parameters\n\n*   `middleware` ([`Middleware`][api-middleware])\n    — middleware function\n\n###### Returns\n\nCurrent pipeline ([`Pipeline`][api-pipeline]).\n\n## Compatibility\n\nThis projects is compatible with maintained versions of Node.js.\n\nWhen we cut a new major release,\nwe drop support for unmaintained versions of Node.\nThis means we try to keep the current release line,\n`trough@2`,\ncompatible with Node.js 12.\n\n## Security\n\nThis package is safe.\n\n## Contribute\n\nYes please!\nSee [How to Contribute to Open Source][open-source-guide-contribute].\n\n## License\n\n[MIT][file-license] © [Titus Wormer][wooorm]\n\n<!-- Definitions -->\n\n[api-callback]: #callback\n\n[api-middleware]: #middleware\n\n[api-pipeline]: #pipeline\n\n[api-run]: #run\n\n[api-trough]: #trough\n\n[api-use]: #use\n\n[api-wrap]: #wrapmiddleware-callback\n\n[badge-build-image]: https://github.com/wooorm/trough/workflows/main/badge.svg\n\n[badge-build-url]: https://github.com/wooorm/trough/actions\n\n[badge-coverage-image]: https://img.shields.io/codecov/c/github/wooorm/trough.svg\n\n[badge-coverage-url]: https://codecov.io/github/wooorm/trough\n\n[badge-downloads-image]: https://img.shields.io/npm/dm/trough.svg\n\n[badge-downloads-url]: https://www.npmjs.com/package/trough\n\n[badge-size-image]: https://img.shields.io/bundlejs/size/trough\n\n[badge-size-url]: https://bundlejs.com/?q=trough\n\n[npm-install]: https://docs.npmjs.com/cli/install\n\n[esm-sh]: https://esm.sh\n\n[file-license]: license\n\n[github-gist-esm]: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c\n\n[github-segmentio-ware]: https://github.com/segmentio/ware\n\n[open-source-guide-contribute]: https://opensource.guide/how-to-contribute/\n\n[typescript]: https://www.typescriptlang.org\n\n[wooorm]: https://wooorm.com\n","_attachments":{},"homepage":"https://github.com/wooorm/trough#readme","bugs":{"url":"https://github.com/wooorm/trough/issues"},"license":"MIT"}