{"_id":"bundles","_rev":"1745785","name":"bundles","description":"Flexible standalone middleware stacker with hooks","dist-tags":{"latest":"2.0.0"},"maintainers":[{"name":"scottcorgan","email":"scottcorgan@gmail.com"}],"time":{"modified":"2026-11-19T14:31:27.000Z","created":"2014-09-23T22:46:28.641Z","2.0.0":"2014-12-17T16:13:29.091Z","1.1.1":"2014-09-27T23:46:29.382Z","1.1.0":"2014-09-27T23:44:32.657Z","1.0.0":"2014-09-24T01:04:10.391Z","0.0.1":"2014-09-23T22:46:28.641Z"},"users":{"oakley349":true},"author":{"name":"Scott Corgan"},"repository":{"type":"git","url":"https://github.com/scottcorgan/bundles.git"},"versions":{"2.0.0":{"name":"bundles","version":"2.0.0","description":"Flexible standalone middleware stacker with hooks","main":"index.js","directories":{"test":"test"},"scripts":{"test":"mocha test/"},"repository":{"type":"git","url":"https://github.com/scottcorgan/bundles.git"},"keywords":["connect","express","stack","bundle"],"author":{"name":"Scott Corgan"},"license":"MIT","bugs":{"url":"https://github.com/scottcorgan/bundles/issues"},"homepage":"https://github.com/scottcorgan/bundles","devDependencies":{"chai":"^1.9.1","connect":"^3.2.0","mocha":"^2.0.1","supertest":"^0.15.0"},"dependencies":{"async":"^0.9.0"},"gitHead":"69bcc3494d3ce073886dc74068133a107a5ff4ae","_id":"bundles@2.0.0","_shasum":"14281d20ae3549ed089b6fe22d5c95b8bb9b63e7","_from":".","_npmVersion":"2.1.11","_nodeVersion":"0.10.31","_npmUser":{"name":"scottcorgan","email":"scottcorgan@gmail.com"},"maintainers":[{"name":"scottcorgan","email":"scottcorgan@gmail.com"}],"dist":{"shasum":"14281d20ae3549ed089b6fe22d5c95b8bb9b63e7","tarball":"http://registry-npm.ywwl.com/bundles/download/bundles-2.0.0.tgz","integrity":"sha512-oLTKf7dQTRrV2Ae+yTLetgbLKAr6w3D+LST7Hh6oJo2SC1aYzYvZE8PJ93e8ivChNg+/QLVHc3eUZKp1CgbHGA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQChdV0H16f0D24t7YZ15xUvwvf+3ER8XjjW4lWdawH8NAIgCQ+fyEt02GlhM9UXmCn1B0zj1mFdCcDv8kzL28onBhg="}],"size":3158,"noattachment":false,"key":"/bundles/-/bundles-2.0.0.tgz"},"publish_time":1418832809091,"_cnpm_publish_time":1418832809091},"1.1.1":{"name":"bundles","version":"1.1.1","description":"Flexible standalone middleware stacker with hooks","main":"index.js","directories":{"test":"test"},"scripts":{"test":"mocha test/"},"repository":{"type":"git","url":"https://github.com/scottcorgan/bundles.git"},"keywords":["connect","express","stack","bundle"],"author":{"name":"Scott Corgan"},"license":"MIT","bugs":{"url":"https://github.com/scottcorgan/bundles/issues"},"homepage":"https://github.com/scottcorgan/bundles","devDependencies":{"chai":"^1.9.1","connect":"^3.2.0","mocha":"^1.21.4","supertest":"^0.13.0"},"dependencies":{"async":"^0.9.0","http-intercept":"^0.1.0"},"gitHead":"7a9d906ed5f2f236d6689028490c392e0fd82330","_id":"bundles@1.1.1","_shasum":"7c9dcab3c3794df52257b5b700065693a03d5e7c","_from":".","_npmVersion":"1.4.23","_npmUser":{"name":"scottcorgan","email":"scottcorgan@gmail.com"},"maintainers":[{"name":"scottcorgan","email":"scottcorgan@gmail.com"}],"dist":{"shasum":"7c9dcab3c3794df52257b5b700065693a03d5e7c","tarball":"http://registry-npm.ywwl.com/bundles/download/bundles-1.1.1.tgz","integrity":"sha512-MpquDAkT3G7i3+LMSLa+BJhqbpJsvgsdRboGmpFBFkg6ZCkrSDvtheFUxSvZIa+haHzZp//0mEl23OYM7uwsqA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIArCwdDAAJY0IvMCz9JdLF1SQB2IiQaxfMyHmETktYKiAiAY83peI6Hlbp1MROHHinX1DnHWxFm2oNtaVG64j7s/zQ=="}],"size":3668,"noattachment":false,"key":"/bundles/-/bundles-1.1.1.tgz"},"publish_time":1411861589382,"_cnpm_publish_time":1411861589382},"1.1.0":{"name":"bundles","version":"1.1.0","description":"Flexible standalone middleware stacker with hooks","main":"index.js","directories":{"test":"test"},"scripts":{"test":"mocha test/"},"repository":{"type":"git","url":"https://github.com/scottcorgan/bundles.git"},"keywords":["connect","express","stack","bundle"],"author":{"name":"Scott Corgan"},"license":"MIT","bugs":{"url":"https://github.com/scottcorgan/bundles/issues"},"homepage":"https://github.com/scottcorgan/bundles","devDependencies":{"chai":"^1.9.1","connect":"^3.2.0","mocha":"^1.21.4","supertest":"^0.13.0"},"dependencies":{"async":"^0.9.0"},"gitHead":"6ad83771bb2b30a67e5968faf3c1b653d70880e2","_id":"bundles@1.1.0","_shasum":"d6ee60714275b88e802a6ae8e415c821c81562f0","_from":".","_npmVersion":"1.4.23","_npmUser":{"name":"scottcorgan","email":"scottcorgan@gmail.com"},"maintainers":[{"name":"scottcorgan","email":"scottcorgan@gmail.com"}],"dist":{"shasum":"d6ee60714275b88e802a6ae8e415c821c81562f0","tarball":"http://registry-npm.ywwl.com/bundles/download/bundles-1.1.0.tgz","integrity":"sha512-82neqcnrUjMt/RHCC7kscoN786OxZOEPRUhG8041gvSRcLjJi4SV0Y4YiBGaGvo6hBffftt/LGxpqh4rQXxUnw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD4YwNThrNM6xoY1YNsFAq5N+ZZgIwJX7QbauYofOy65QIgHE/bSZBXKBMqQgLPY3Pe3wEIoWT0t6G9bvu+RK07K7s="}],"size":3662,"noattachment":false,"key":"/bundles/-/bundles-1.1.0.tgz"},"publish_time":1411861472657,"_cnpm_publish_time":1411861472657},"1.0.0":{"name":"bundles","version":"1.0.0","description":"Flexible standalone middleware stacker with hooks","main":"index.js","directories":{"test":"test"},"scripts":{"test":"mocha test/"},"repository":{"type":"git","url":"https://github.com/scottcorgan/bundles.git"},"keywords":["connect","express","stack","bundle"],"author":{"name":"Scott Corgan"},"license":"MIT","bugs":{"url":"https://github.com/scottcorgan/bundles/issues"},"homepage":"https://github.com/scottcorgan/bundles","devDependencies":{"chai":"^1.9.1","connect":"^3.2.0","mocha":"^1.21.4","supertest":"^0.13.0"},"dependencies":{"async":"^0.9.0"},"gitHead":"06f1758e9124eb8b6ea68c7e7f4343ffa7008cc9","_id":"bundles@1.0.0","_shasum":"fd932a9d1442dc04db8668e93dbd2044023ffa15","_from":".","_npmVersion":"1.4.23","_npmUser":{"name":"scottcorgan","email":"scottcorgan@gmail.com"},"maintainers":[{"name":"scottcorgan","email":"scottcorgan@gmail.com"}],"dist":{"shasum":"fd932a9d1442dc04db8668e93dbd2044023ffa15","tarball":"http://registry-npm.ywwl.com/bundles/download/bundles-1.0.0.tgz","integrity":"sha512-v3YjbhX1bz5e8AfHyrAvcyje4eKFlS7R626frEXT2yl+K0Dmcxfp5OkPj+VN43X8zQ0aA6HQl9232tOMLesIBg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDQnm1pEsMJgf09bLXwZ0on8fQEnmhP7d7IdLbF3rpfuAIhAJvyy/qxZ8sqRL5eWA4PS/3VJ11KUt2RDhvWbPvkE3pA"}],"size":3056,"noattachment":false,"key":"/bundles/-/bundles-1.0.0.tgz"},"publish_time":1411520650391,"_cnpm_publish_time":1411520650391},"0.0.1":{"name":"bundles","version":"0.0.1","description":"Flexible standalone middleware stacker with hooks","main":"index.js","directories":{"test":"test"},"scripts":{"test":"mocha test/"},"repository":{"type":"git","url":"https://github.com/scottcorgan/bundles.git"},"keywords":["connect","express","stack","bundle"],"author":{"name":"Scott Corgan"},"license":"MIT","bugs":{"url":"https://github.com/scottcorgan/bundles/issues"},"homepage":"https://github.com/scottcorgan/bundles","gitHead":"56c848fb82502e54bf08222767355e6b9c6f5e36","_id":"bundles@0.0.1","_shasum":"9aefca2d2f3946930d78cde239ee2b78900cfb52","_from":".","_npmVersion":"1.4.23","_npmUser":{"name":"scottcorgan","email":"scottcorgan@gmail.com"},"maintainers":[{"name":"scottcorgan","email":"scottcorgan@gmail.com"}],"dist":{"shasum":"9aefca2d2f3946930d78cde239ee2b78900cfb52","tarball":"http://registry-npm.ywwl.com/bundles/download/bundles-0.0.1.tgz","integrity":"sha512-r2uWCb8LDL22SxRsSG3sD7B52sDJmGbC9LngN/eMyu9w/3jwvLztVqPFIREiCC0rx3iBh0v03uX7OU8J8TdPQg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCa1w9SZaRUumMHW9Cf37Nv7e9DJGFN3sZ9YdnxPJ6GbAIhAOiAQRN4vjg3eWvihDj5AHNlAHLGxqJyzksAfF4acyHw"}],"size":1527,"noattachment":false,"key":"/bundles/-/bundles-0.0.1.tgz"},"publish_time":1411512388641,"_cnpm_publish_time":1411512388641}},"readme":"# bundles\n\nFlexible standalone middleware stacker with hooks. This is useful for bundling together functionality as one standalone middleware for use with other modules like [Connect](https://www.npmjs.org/package/connect) or [Express](https://www.npmjs.org/package/express).\n\n## Install\n\n```\nnpm install bundles --save\n```\n\n## Usage\n\nBasic\n\n```js\nvar bundles = require('bundles');\nvar connect = require('connect');\n\nvar bundle = bundles();\n\nbundle.use(function (req, res, next) {\n  // do something\n  next();\n});\n\napp.use(bundle);\n\napp.listen(3000, function () {\n  \n});\n```\n\nHooks and named middleware\n\n```js\nvar bundles = require('bundles');\nvar connect = require('connect');\n\nvar bundle = bundles();\n\nbundle.use('bundle1', function (req, res, next) {\n  // do something\n  next();\n});\n\nbundle.useBefore('bundle1', function (req, res, next) {\n  // executes before bundle1\n  next();\n});\n\nbundle.useAfter('bundle1', function (req, res, next) {\n  // executes after bundle1\n  next();\n});\n\napp.use(bundle);\n\napp.listen(3000, function () {\n  \n});\n```\n\n## API\n\n### bundle.use([name, ] callback)\n\nDeclare middleware in the bundle.\n\n* `name` - OPTIONAL - name of the middleware. Useful for hook into middleware chain\n* `callback` - typical middleware callback to that takes 3 arguments: `req`, `res`, `next`\n\n### bundle.useBefore(name, callback)\n\nHook a middleware before the named middleware\n\n* `name` - the name of the middleware to hook before\n* `callback` - typical middleware callback to that takes 3 arguments: `req`, `res`, `next`\n\n### bundle.useAfter(name, callback)\n\nHook a middleware after the named middleware\n\n* `name` - the name of the middleware to hook after\n* `callback` - typical middleware callback to that takes 3 arguments: `req`, `res`, `next`\n\n## Run Tests\n\n```\nnpm install\nnpm test\n```","_attachments":{},"homepage":"https://github.com/scottcorgan/bundles","bugs":{"url":"https://github.com/scottcorgan/bundles/issues"},"license":"MIT"}