{"_id":"@parkhub/circe-middleware","_rev":"51-637a2b0f5d45f4fca2cbb541e30c0f7a","name":"@parkhub/circe-middleware","dist-tags":{"latest":"1.1.0"},"versions":{"1.0.0":{"name":"@parkhub/circe-middleware","version":"1.0.0","author":{"name":"Daniel Olivares"},"_id":"@parkhub/circe-middleware@1.0.0","maintainers":[{"name":"sirmyztiq","email":"fuzzoli87@gmail.com"}],"homepage":"https://github.com/parkhub/circe-middleware#readme","bugs":{"url":"https://github.com/parkhub/circe-middleware/issues"},"dist":{"shasum":"73bede958919a0a06e4124e115279049f0dbd270","tarball":"https://registry.npmjs.org/@parkhub/circe-middleware/-/circe-middleware-1.0.0.tgz","integrity":"sha512-Dmi63kdQJKzn9gFfHRwcE0DdGu1c/fHwlysSMGB83rmfm3X3wePuc+tALv6iqYXp80kOxt05KX6UqrkxLQ/DsA==","signatures":[{"sig":"MEUCIQDT6mIc3VltEsr+CJ9mwLyCsGZAje0GmbpBSZMldT3xDAIgSUFa10i/r+rytAYyakQ++zYzIouc4JL86kFsQyt+0UE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"jest":{"verbose":true,"testMatch":["**/src/**/?(*.)test.js?(x)"],"collectCoverage":true,"coverageThreshold":{"global":{"lines":100,"branches":100,"functions":100,"statements":100}},"modulePathIgnorePatterns":["dist/*"],"coveragePathIgnorePatterns":["/node_modules/","/dist/"]},"main":"dist/index.js","files":["dist"],"config":{"commitizen":{"path":"cz-conventional-changelog"}},"engines":{"npm":">=3","node":">=8.0.0"},"gitHead":"4f7cd8be3589992b58169640b6bd0397d71cf368","release":{"debug":false,"verifyConditions":"condition-codefresh"},"scripts":{"start":"nps","commitmsg":"opt --in commit-msg --exec \"validate-commit-msg\"","precommit":"opt --in pre-commit --exec \"npm start validate\""},"_npmUser":{"name":"sirmyztiq","email":"fuzzoli87@gmail.com"},"repository":{"url":"git+https://github.com/parkhub/circe-middleware.git","type":"git"},"_npmVersion":"5.3.0","description":"A simple module that takes an array of functions(middleware) and passes the result of each to the next function in the array in order!","directories":{},"_nodeVersion":"8.4.0","publishConfig":{"access":"public"},"devDependencies":{"nps":"^5.7.1","jest":"^20.0.4","husky":"^0.14.3","eslint":"^4.5.0","leasot":"^4.10.1","rimraf":"^2.6.1","codecov":"^2.3.0","opt-cli":"^1.5.2","flow-bin":"^0.54.0","babel-cli":"^6.26.0","nps-utils":"^1.3.0","babel-jest":"^20.0.3","commitizen":"^2.9.6","flow-typed":"^2.1.5","babel-eslint":"^7.2.3","documentation":"^5.2.2","are-we-flow-yet":"^1.0.0","babel-preset-env":"^1.6.0","flow-copy-source":"^1.2.1","semantic-release":"^7.0.2","babel-preset-flow":"^6.23.0","flow-remove-types":"^1.2.1","eslint-plugin-jest":"^20.0.3","condition-codefresh":"^1.0.1","eslint-plugin-babel":"^4.1.2","prettier-eslint-cli":"^4.3.0","validate-commit-msg":"^2.14.0","eslint-plugin-import":"^2.7.0","eslint-plugin-flowtype":"^2.35.1","cz-conventional-changelog":"^2.0.0","eslint-config-airbnb-base":"^11.3.2","babel-plugin-transform-strict-mode":"^6.24.1","@parkhub/eslint-config-parkhub-base":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/circe-middleware-1.0.0.tgz_1504305180577_0.921794168651104","host":"s3://npm-registry-packages"}},"1.1.0":{"name":"@parkhub/circe-middleware","version":"1.1.0","author":{"name":"Daniel Olivares"},"_id":"@parkhub/circe-middleware@1.1.0","maintainers":[{"name":"bfletcherbiggs","email":"bfletcherbiggs@gmail.com"},{"name":"ggellene","email":"greg.gellene@gmail.com"},{"name":"sirmyztiq","email":"fuzzoli87@gmail.com"},{"name":"jonsenterfitt","email":"jon.senterfitt@parkhub.com"},{"name":"thetwosents","email":"jon@belfortagency.com"},{"name":"loganbfisher","email":"logan@themediaside.com"},{"name":"realtschoegl","email":"matt.tschoegl@parkhub.com"}],"homepage":"https://github.com/parkhub/circe-middleware#readme","bugs":{"url":"https://github.com/parkhub/circe-middleware/issues"},"dist":{"shasum":"36681864f2866376e2bbf39a195f87510779641b","tarball":"https://registry.npmjs.org/@parkhub/circe-middleware/-/circe-middleware-1.1.0.tgz","integrity":"sha512-mzapf8mqAtg8oTeMk2m7J5ehFrIrgRcZbmhOda59Ya06HVVjTHtpRSFj1S2ISTaRPouLg8IuxSxpjk9SrE4M8g==","signatures":[{"sig":"MEUCIAtD05HZp0xuNJMuV7H7sUMk3/9bDkSYihJdaaW6Gxu4AiEAkx7+52V3RfimOGKkpH3pP6woOlLZDDr51Y7sM/zb4rY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"jest":{"verbose":true,"testMatch":["**/src/**/?(*.)test.js?(x)"],"collectCoverage":true,"coverageThreshold":{"global":{"lines":100,"branches":100,"functions":100,"statements":100}},"modulePathIgnorePatterns":["dist/*"],"coveragePathIgnorePatterns":["/node_modules/","/dist/"]},"main":"dist/index.js","files":["dist"],"config":{"commitizen":{"path":"cz-conventional-changelog"}},"engines":{"npm":">=3","node":">=8.0.0"},"gitHead":"e7df457706cc8e4f66672836d9d6266147d9d79b","release":{"debug":false,"verifyConditions":"condition-codefresh"},"scripts":{"start":"nps","commitmsg":"opt --in commit-msg --exec \"validate-commit-msg\"","precommit":"opt --in pre-commit --exec \"npm start validate\""},"_npmUser":{"name":"sirmyztiq","email":"fuzzoli87@gmail.com"},"repository":{"url":"git+https://github.com/parkhub/circe-middleware.git","type":"git"},"_npmVersion":"5.3.0","description":"A simple middleware module that you know and love. Using the \"next\" pattern means you can have async/sync middleware!","directories":{},"_nodeVersion":"8.4.0","publishConfig":{"access":"public"},"devDependencies":{"nps":"^5.7.1","jest":"^21.0.2","husky":"^0.14.3","eslint":"^4.6.1","leasot":"^4.10.1","rimraf":"^2.6.2","codecov":"^2.3.0","opt-cli":"^1.5.2","flow-bin":"^0.54.1","babel-cli":"^6.26.0","nps-utils":"^1.3.0","babel-jest":"^21.0.2","commitizen":"^2.9.6","flow-typed":"^2.1.5","babel-eslint":"^8.0.0","documentation":"^5.3.1","are-we-flow-yet":"^1.0.0","babel-preset-env":"^1.6.0","flow-copy-source":"^1.2.1","semantic-release":"^7.0.2","babel-preset-flow":"^6.23.0","flow-remove-types":"^1.2.1","eslint-plugin-jest":"^21.0.2","condition-codefresh":"^1.0.1","eslint-plugin-babel":"^4.1.2","prettier-eslint-cli":"4.3.0","validate-commit-msg":"^2.14.0","eslint-plugin-import":"^2.7.0","eslint-plugin-flowtype":"^2.35.1","cz-conventional-changelog":"^2.0.0","babel-plugin-transform-strict-mode":"^6.24.1","@parkhub/eslint-config-parkhub-base":"^1.1.0"},"_npmOperationalInternal":{"tmp":"tmp/circe-middleware-1.1.0.tgz_1505242331482_0.9291980545967817","host":"s3://npm-registry-packages"}}},"time":{"created":"2017-09-01T22:33:01.513Z","modified":"2026-09-21T18:05:25.730Z","1.0.0":"2017-09-01T22:33:01.513Z","1.1.0":"2017-09-12T18:52:13.066Z"},"bugs":{"url":"https://github.com/parkhub/circe-middleware/issues"},"author":{"name":"Daniel Olivares"},"homepage":"https://github.com/parkhub/circe-middleware#readme","repository":{"url":"git+https://github.com/parkhub/circe-middleware.git","type":"git"},"description":"A simple middleware module that you know and love. Using the \"next\" pattern means you can have async/sync middleware!","maintainers":[{"email":"daytonpe14@gmail.com","name":"daytonpe"},{"email":"matt.tschoegl@parkhub.com","name":"realtschoegl"},{"email":"alexander.cauble@gmail.com","name":"accloudcoder"},{"email":"jbrooks02@gmail.com","name":"novym"},{"email":"jebenavidez@outlook.com","name":"justin-ben"},{"email":"thiel.talicuran@parkhub.com","name":"thielt"},{"email":"stephen.emerson@parkhub.com","name":"stephemer"},{"email":"nathaniel.brown@parkhub.com","name":"nathaniel.brown"},{"email":"austin.lewis@justpark.com","name":"austin.lewis.justpark"},{"email":"landon.parris@justpark.com","name":"landon.parris"},{"email":"zoe.chamlee@parkhub.com","name":"zchamlee"},{"email":"joni@bek.io","name":"honi"},{"email":"colinc86@gmail.com","name":"electrocampbell"},{"email":"josh.boyle@justpark.com","name":"joshaboyle"},{"email":"loumonth.jack@justpark.com","name":"loumonth.jack"},{"email":"david.yang@justpark.com","name":"davidyang.justpark"},{"email":"dylan.delarosa@justpark.com","name":"delarosadyljp"},{"email":"rj.ellazar@justpark.com","name":"rjellazar"},{"email":"jack.anthony.wall@gmail.com","name":"j4k"},{"email":"hannah.ismail@parkhub.com","name":"hannahi771"},{"email":"jason@jasonlusk.com","name":"mpalpha"},{"email":"shane.frykholm@justpark.com","name":"mrshanef"}],"readme":"# Circe Middleware\n\nA simple middleware module that you know and love. Using the \"next\" pattern means you can have async/sync middleware!\n\n[![Build Status][build-badge]][build]\n[![Code Coverage][coverage-badge]][coverage]\n[![Dependencies][dependencyci-badge]][dependencyci]\n[![version][version-badge]][package]\n[![Apache License][license-badge]][LICENSE]\n[![PRs Welcome][prs-badge]][prs]\n[![Roadmap][roadmap-badge]][roadmap]\n[![Semantic Release][semantic-release-badge]][sem-release-badge]\n[![Commitizen][commitizen-friendly-badge]][comm-friendly-badge]\n\n\n[![Watch on GitHub][github-watch-badge]][github-watch]\n[![Star on GitHub][github-star-badge]][github-star]\n[![Tweet][twitter-badge]][twitter]\n\n## Install\n```bash\nnpm install @parkhub/circe-middleware\n```\n\n## Usage\n```javascript\nimport circeMiddleware from '@parkhub/circe-middleware';\n\nconst middlewareFnOne = (value, next) => {\n  // value is 'starting value'\n\n  // Call next and pass params with any arity(as long as next middleware expects the same arity)\n  next('Satsuki!');\n};\n\nconst middlewareFnTwo = (value, next) => {\n  // Value is 'Satsuki!'\n\n  // Call next and pass params with any arity(as long as next middleware expects the same arity)\n  next({ going: 'gone' }, 1);\n};\n\nconst middlewareFnThree = (obj, int, next) => {\n  // obj is { going: 'gone' } and int is 1\n\n  next('done');\n}\n\n// The middleware is executed in the order of the passed array\nconst middleware = circeMiddleware([middlewareFnOne, middlewareFnTwo]);\n\n// This middleware will be executed after the first two passed into the middleware factory\nmiddleware.use(middlewareFnThree);\n\nmiddleware.run('starting value', (finalValue) => {\n  // finalValue is 'done'\n});\n```\n\n## Middlewares\nA middleware is a function that receives an arbitrary number of parameters with the last one being the **next** function. \n**You have to be conscious of the order of the middlware and what it accepts as parameters**\n\n## API\n### use(middlewareFn)\n#### middlewareFn - a function with signature of (arg1, arg2, ...argX, next)\nAdds a middleware to the middleware stack.\n\n### run(...args, () => {})\n### The parameters passed into the run method are first with the last parameter being the FINAL function the middlewares\n\n\n[semantic-release-badge]: https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg\n[sem-release-badge]: https://github.com/semantic-release/semantic-release\n[build-badge]:  https://g.codefresh.io/api/badges/build?repoOwner=parkhub&repoName=circe-middleware&branch=master&pipelineName=circe-middleware&accountName=loganbfisher&type=cf-1\n[build]:  https://g.codefresh.io/repositories/parkhub/circe-middleware/builds?filter=trigger:build;branch:master;service:59821c960ae1710001fef83c~circe-middleware\n[coverage-badge]: https://img.shields.io/codecov/c/github/parkhub/circe-middleware.svg?style=flat-square\n[coverage]: https://codecov.io/gh/parkhub/circe-middleware\n[dependencyci-badge]: https://dependencyci.com/github/parkhub/circe-middleware/badge?style=flat-square\n[dependencyci]: https://dependencyci.com/github/parkhub/circe-middleware\n[version-badge]: https://img.shields.io/npm/v/@parkhub/circe-middleware.svg?style=flat-square\n[package]: https://www.npmjs.com/package/@parkhub/circe-middleware\n[license-badge]: https://img.shields.io/badge/License-Apache%202.0-blue.svg\n[license]: https://github.com/parkhub/circe-middleware/blob/master/LICENSE\n[prs-badge]: https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square\n[prs]: http://makeapullrequest.com\n[roadmap-badge]: https://img.shields.io/badge/%F0%9F%93%94-roadmap-CD9523.svg?style=flat-square\n[roadmap]: https://github.com/parkhub/circe-middleware/blob/master/ROADMAP.md\n[github-watch-badge]: https://img.shields.io/github/watchers/parkhub/circe-middleware.svg?style=social\n[github-watch]: https://github.com/parkhub/circe-middleware/watchers\n[github-star-badge]: https://img.shields.io/github/stars/parkhub/circe-middleware.svg?style=social\n[github-star]: https://github.com/parkhub/circe-middleware/stargazers\n[twitter]: https://twitter.com/intent/tweet?text=Check%20out%20prettier-eslint-cli!%20https://github.com/parkhub/circe-middleware%20%F0%9F%91%8D\n[twitter-badge]: https://img.shields.io/twitter/url/https/github.com/parkhub/circe-middleware.svg?style=social\n[semantic-release]: https://github.com/semantic-release/semantic-release\n[commitizen-friendly-badge]: https://img.shields.io/badge/commitizen-friendly-brightgreen.svg\n[comm-friendly-badge]: http://commitizen.github.io/cz-cli/\n\n\n\n\n\n\n","readmeFilename":"README.md"}