{"_id":"bomb","_rev":"30-0a816691120170cf819ac20d430b00ce","name":"bomb","time":{"modified":"2022-06-13T04:54:48.697Z","created":"2011-11-02T21:56:09.034Z","0.0.0":"2011-11-02T21:56:09.683Z","0.0.1":"2011-11-02T22:20:16.486Z","1.0.0":"2015-03-18T23:15:53.606Z","1.1.0":"2015-03-18T23:22:04.101Z","1.2.0":"2015-03-18T23:24:07.756Z","1.2.1":"2015-03-18T23:26:26.959Z","1.2.2":"2015-03-18T23:39:01.840Z","1.2.3":"2015-03-18T23:41:37.981Z","1.2.4":"2015-03-18T23:42:07.154Z","1.3.0":"2015-03-19T07:00:21.479Z","1.3.1":"2015-03-19T07:01:08.214Z","1.4.0":"2015-03-19T07:21:35.616Z","1.5.0":"2015-03-19T08:01:03.516Z"},"maintainers":[{"name":"mtharrison","email":"hi@matt-harrison.com"}],"dist-tags":{"latest":"1.5.0"},"description":"A frontend cache-busting static middleware for express","readme":"# bomb\nA frontend cache-busting static middleware for express.\n\n- Acts as a static middleware\n- Serves on a hashed filename route too\n\n###Install \n\n`npm install --save bomb`\n\n###Example\n\nLet's say we want to serve all the css, js and HTML files in our public directory:\n\n    ├── index.js\n        └── public\n            ├── example.css\n            ├── example.js\n            ├── other.txt\n            ├── example.png\n            └── other\n                └── index.html\n                \nWe can create a new bomb box and use it as a middleware:\n\n    var Express = require('express');\n    var Bomb = require('bomb');\n    var Path = require('path');\n    \n    var app = Express();\n    \n    var box = new Bomb.Box({\n        url: '/public',                           // use this as the URL root\n        path: Path.join(__dirname, 'public'),     // look in this directory for files\n        regex: /\\.(css|js|html)/                  // only serve files that match regex\n        sendOptions: {}                           // options for the `send` module\n    });\n    \n    app.use(box);\n    \n    app.listen(4000);\n  \nWe can now request the files on the natural or hashed URLS:\n\n- `/public/example.css`\n- `/public/example-4591dd5c9fd5aab8f5d7df6ac939441c.css`\n- `/public/example.js`\n- `/public/example-00e062122c3306198fdbe5d3ddd01fe0.js`\n- `/public/other/index.html`\n- `/public/other/index-33c805c6162941684b6fc618d0e42ab8.html`\n\nTo get the hashed URL from a natural one, just call `box.getHashedUrl(url)`:\n\n`box.getHashedUrl('/public/example.css') === '/public/example-4591dd5c9fd5aab8f5d7df6ac939441c.css'`\n\nTo get the natural URL from a hashed one, just call `box.getNaturalUrl(url)`:\n\n`box.getNaturalUrl('/public/example-4591dd5c9fd5aab8f5d7df6ac939441c.css') === '/public/example.css'`\n","versions":{"1.0.0":{"name":"bomb","version":"1.0.0","description":"A cache busting middleware for express","main":"index.js","directories":{"example":"examples"},"scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"https://github.com/mtharrison/busta.git"},"author":{"name":"Matt Harrison","email":"hi@matt-harrison.com"},"license":"MIT","bugs":{"url":"https://github.com/mtharrison/busta/issues"},"homepage":"https://github.com/mtharrison/busta","devDependencies":{"express":"^4.12.3"},"dependencies":{"MD5":"^1.2.1","joi":"^6.0.8","mime":"^1.3.4","wrench":"^1.5.8"},"gitHead":"49e647d0277041f75d556a58b7567f515214b761","_id":"bomb@1.0.0","_shasum":"af40f30a2c6f6e376917d5e96d2ca94943887f41","_from":".","_npmVersion":"2.0.0","_npmUser":{"name":"mtharrison","email":"hi@matt-harrison.com"},"maintainers":[{"name":"mtharrison","email":"hi@matt-harrison.com"}],"dist":{"shasum":"af40f30a2c6f6e376917d5e96d2ca94943887f41","tarball":"https://registry.npmjs.org/bomb/-/bomb-1.0.0.tgz","integrity":"sha512-iQcZ4O1Q230lSHu2VKzgMv70b3ah/HkK7ATy8dLpJQicB5WGN47AFZJ67pW3qmRoL6kpblQdb4duYlPOMf1xNw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEFNRPwkcu3Bl7dsFAL/rULTRk6PZ0ucer0BEvE+M0IbAiB2L67zYOEmdbrsQBqwDC4Kj1H886NLvsgK/zVk8CnwJQ=="}]}},"1.1.0":{"name":"bomb","version":"1.1.0","description":"A cache busting middleware for express","main":"index.js","directories":{"example":"examples"},"scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"https://github.com/mtharrison/bomb.git"},"author":{"name":"Matt Harrison","email":"hi@matt-harrison.com"},"license":"MIT","bugs":{"url":"https://github.com/mtharrison/bomb/issues"},"homepage":"https://github.com/mtharrison/bomb","devDependencies":{"express":"^4.12.3"},"dependencies":{"MD5":"^1.2.1","joi":"^6.0.8","mime":"^1.3.4","wrench":"^1.5.8"},"gitHead":"7e65d8c56f246274911f882cedac1a528f217463","_id":"bomb@1.1.0","_shasum":"cd7f89fd7bd1e891d503c7ddf5f65ddeefd1b3f4","_from":".","_npmVersion":"2.0.0","_npmUser":{"name":"mtharrison","email":"hi@matt-harrison.com"},"maintainers":[{"name":"mtharrison","email":"hi@matt-harrison.com"}],"dist":{"shasum":"cd7f89fd7bd1e891d503c7ddf5f65ddeefd1b3f4","tarball":"https://registry.npmjs.org/bomb/-/bomb-1.1.0.tgz","integrity":"sha512-8op9mKH5fLooMCD9XeK7UHtyacgbiY8PjSCLTMIx1HU1AbeCVKPc2nwZoTo1+DnsiflenNog7MvDZ1huqL0lyQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD/RYpBzSTk+bJGJq7yxlTS43b//epATNhIjqtdaDmE7QIgGEEDeo/YSLAY2BjybLBB+p3jUgvSjwkWAAEakQJWSmA="}]}},"1.2.0":{"name":"bomb","version":"1.2.0","description":"A cache busting middleware for express","main":"index.js","directories":{"example":"examples"},"scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"https://github.com/mtharrison/bomb.git"},"author":{"name":"Matt Harrison","email":"hi@matt-harrison.com"},"license":"MIT","bugs":{"url":"https://github.com/mtharrison/bomb/issues"},"homepage":"https://github.com/mtharrison/bomb","devDependencies":{"express":"^4.12.3"},"dependencies":{"MD5":"^1.2.1","joi":"^6.0.8","mime":"^1.3.4","wrench":"^1.5.8"},"gitHead":"73251014c9f053ca556ef36658daa1cb790b70ab","_id":"bomb@1.2.0","_shasum":"8b277393aff7600b740f7129f79aaee8db23bbe1","_from":".","_npmVersion":"2.0.0","_npmUser":{"name":"mtharrison","email":"hi@matt-harrison.com"},"maintainers":[{"name":"mtharrison","email":"hi@matt-harrison.com"}],"dist":{"shasum":"8b277393aff7600b740f7129f79aaee8db23bbe1","tarball":"https://registry.npmjs.org/bomb/-/bomb-1.2.0.tgz","integrity":"sha512-DOefbW5K46zPMx6Sa4OmZK2FOSmKYsDWBPyXYakzKzMN2tMmmizSE3tzjreOfgdeev9fTwaX2X3It+L6GxpgeQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDSB8ajipNn9Sdc0YJNWMxv5uId1QGPsVOMbowNebss/wIgJwu94ihn33Udq2DEth+GgZqXp7aaClSr7hvrHLsSZzU="}]}},"1.2.1":{"name":"bomb","version":"1.2.1","description":"A cache busting middleware for express","main":"index.js","directories":{"example":"examples"},"scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"https://github.com/mtharrison/bomb.git"},"author":{"name":"Matt Harrison","email":"hi@matt-harrison.com"},"license":"MIT","bugs":{"url":"https://github.com/mtharrison/bomb/issues"},"homepage":"https://github.com/mtharrison/bomb","devDependencies":{"express":"^4.12.3"},"dependencies":{"MD5":"^1.2.1","joi":"^6.0.8","mime":"^1.3.4","wrench":"^1.5.8"},"gitHead":"486b4852c056f5c33052c4d6f25a59c51c6236a9","_id":"bomb@1.2.1","_shasum":"0734ec99599d37144a29a51cde8f261acd69a06f","_from":".","_npmVersion":"2.0.0","_npmUser":{"name":"mtharrison","email":"hi@matt-harrison.com"},"maintainers":[{"name":"mtharrison","email":"hi@matt-harrison.com"}],"dist":{"shasum":"0734ec99599d37144a29a51cde8f261acd69a06f","tarball":"https://registry.npmjs.org/bomb/-/bomb-1.2.1.tgz","integrity":"sha512-F1aZ6eIqWix4WeKZCPv2SNJCdeYht7gMvHZnH1qp0/E+cPRxtepGqgJz9+sj42CuspHuYrRxvsoOCGOBlkJ7zg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDqkz4awhN38Arvwei7uuGWwEQdNw1fSWTgNEYyGUCemQIgQqa7X6tr4/UrKZYsiw0gnd/kTntShe9rJAfi6Qdy0UA="}]}},"1.2.2":{"name":"bomb","version":"1.2.2","description":"A cache busting middleware for express","main":"index.js","directories":{"example":"examples"},"scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"https://github.com/mtharrison/bomb.git"},"author":{"name":"Matt Harrison","email":"hi@matt-harrison.com"},"license":"MIT","bugs":{"url":"https://github.com/mtharrison/bomb/issues"},"homepage":"https://github.com/mtharrison/bomb","devDependencies":{"express":"^4.12.3"},"dependencies":{"MD5":"^1.2.1","joi":"^6.0.8","mime":"^1.3.4","wrench":"^1.5.8"},"gitHead":"7191e3a997e21a0fcb2e5df7e9d3eef8a27128e7","_id":"bomb@1.2.2","_shasum":"930016e98be5934ffa2aece295cab5c69ddd4839","_from":".","_npmVersion":"2.0.0","_npmUser":{"name":"mtharrison","email":"hi@matt-harrison.com"},"maintainers":[{"name":"mtharrison","email":"hi@matt-harrison.com"}],"dist":{"shasum":"930016e98be5934ffa2aece295cab5c69ddd4839","tarball":"https://registry.npmjs.org/bomb/-/bomb-1.2.2.tgz","integrity":"sha512-Txe0mCWwBP1djth3rqjTDUzEyjWo5x0dtF96HpeZ2s6szapBnDuXuX5hBEHSf+JOcVsoQdivNGVqQ2xViaWXBA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDtrgLsuAtK8r9HrSj7B225R4wmLGT+y7yN/n6vD+yxCgIhAOM0s2qQopJh7Gh1SnZxJ506WyuzH0X3IZ5/Pfc9YBRz"}]}},"1.2.3":{"name":"bomb","version":"1.2.3","description":"A frontend cache-busting static middleware for express","main":"index.js","directories":{"example":"examples"},"scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"https://github.com/mtharrison/bomb.git"},"author":{"name":"Matt Harrison","email":"hi@matt-harrison.com"},"license":"MIT","bugs":{"url":"https://github.com/mtharrison/bomb/issues"},"homepage":"https://github.com/mtharrison/bomb","devDependencies":{"express":"^4.12.3"},"dependencies":{"MD5":"^1.2.1","joi":"^6.0.8","mime":"^1.3.4","wrench":"^1.5.8"},"gitHead":"748d497b6d5f8aa2b33683d1719228c5255a91d4","_id":"bomb@1.2.3","_shasum":"e1ea89cd2c6863ed7b48c8452d7253e7bf6cddaa","_from":".","_npmVersion":"2.0.0","_npmUser":{"name":"mtharrison","email":"hi@matt-harrison.com"},"maintainers":[{"name":"mtharrison","email":"hi@matt-harrison.com"}],"dist":{"shasum":"e1ea89cd2c6863ed7b48c8452d7253e7bf6cddaa","tarball":"https://registry.npmjs.org/bomb/-/bomb-1.2.3.tgz","integrity":"sha512-XPx6vVJMl9uOlVsd8pcGULWz4nsqkfCq4LYWR5f0Bzf3FGIlW1h9jFhfHs6bX+e1wHKCuqLsVYHsA3b1dmPFhQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDGUpwlu1UQAre/aNTUAkUIxDYFSmm4gWWzq/k8q1N3JAIhANtBV5Wi8UNkNy7TFc/73BcNcuFqIM7CbuF47DEemyYH"}]}},"1.2.4":{"name":"bomb","version":"1.2.4","description":"A frontend cache-busting static middleware for express","main":"index.js","directories":{"example":"examples"},"scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"https://github.com/mtharrison/bomb.git"},"author":{"name":"Matt Harrison","email":"hi@matt-harrison.com"},"license":"MIT","bugs":{"url":"https://github.com/mtharrison/bomb/issues"},"homepage":"https://github.com/mtharrison/bomb","devDependencies":{"express":"^4.12.3"},"dependencies":{"MD5":"^1.2.1","joi":"^6.0.8","mime":"^1.3.4","wrench":"^1.5.8"},"gitHead":"d1eb9fa0fd561b7c3df10952d3ce996c5c08261c","_id":"bomb@1.2.4","_shasum":"fcff46c550d337476860a622d2087a474121a404","_from":".","_npmVersion":"2.0.0","_npmUser":{"name":"mtharrison","email":"hi@matt-harrison.com"},"maintainers":[{"name":"mtharrison","email":"hi@matt-harrison.com"}],"dist":{"shasum":"fcff46c550d337476860a622d2087a474121a404","tarball":"https://registry.npmjs.org/bomb/-/bomb-1.2.4.tgz","integrity":"sha512-X4LV/HgZDe8f1r9kl8f+KJq1AGveraHfp+bzNHYoeHPvVNcgNyBxkv8pFwxklepa3vaxCuFUOt3xUrxK+zP/RA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDCYTJsU8AWcH4uJbsEelIfvsGtnIVASGQPJfKMOg9tnAiBD7VtgUf3Ubj0mu4/yMDHR0HE3OpSwOSPyl0xVDWh7Ag=="}]}},"1.3.0":{"name":"bomb","version":"1.3.0","description":"A frontend cache-busting static middleware for express","main":"index.js","directories":{"example":"examples"},"scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"https://github.com/mtharrison/bomb.git"},"author":{"name":"Matt Harrison","email":"hi@matt-harrison.com"},"license":"MIT","bugs":{"url":"https://github.com/mtharrison/bomb/issues"},"homepage":"https://github.com/mtharrison/bomb","devDependencies":{"express":"^4.12.3"},"dependencies":{"MD5":"^1.2.1","joi":"^6.0.8","mime":"^1.3.4","send":"^0.12.2","wrench":"^1.5.8"},"gitHead":"75477c43d4f124d08d136dcbd58104411342a9d3","_id":"bomb@1.3.0","_shasum":"7ea9605595c824f02f945e2e6d1a364025daa39d","_from":".","_npmVersion":"1.4.28","_npmUser":{"name":"mtharrison","email":"hi@matt-harrison.com"},"maintainers":[{"name":"mtharrison","email":"hi@matt-harrison.com"}],"dist":{"shasum":"7ea9605595c824f02f945e2e6d1a364025daa39d","tarball":"https://registry.npmjs.org/bomb/-/bomb-1.3.0.tgz","integrity":"sha512-54t7arpzXXlrNGLEkPMnn8GmNOL5PNC5CNWXC7h4thx1pZMLvqgNYoI6Vtz5fP3MlGtD1G+xA4bepCg35H7rNg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAzhGR265fODMUiH+0mSo+qSdTQKL0+azocfYAL45GC+AiEA7cz014W7ZAb2MxVvwfjPiNaX9XbW9aNSwxRK+plN9HY="}]}},"1.3.1":{"name":"bomb","version":"1.3.1","description":"A frontend cache-busting static middleware for express","main":"index.js","directories":{"example":"examples"},"scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"https://github.com/mtharrison/bomb.git"},"author":{"name":"Matt Harrison","email":"hi@matt-harrison.com"},"license":"MIT","bugs":{"url":"https://github.com/mtharrison/bomb/issues"},"homepage":"https://github.com/mtharrison/bomb","devDependencies":{"express":"^4.12.3"},"dependencies":{"MD5":"^1.2.1","joi":"^6.0.8","mime":"^1.3.4","send":"^0.12.2","wrench":"^1.5.8"},"gitHead":"955b07a5a6534be206f76549b4c4fd1189243704","_id":"bomb@1.3.1","_shasum":"f5957c429c5214ebd77f917ef10e8cf615b2419c","_from":".","_npmVersion":"1.4.28","_npmUser":{"name":"mtharrison","email":"hi@matt-harrison.com"},"maintainers":[{"name":"mtharrison","email":"hi@matt-harrison.com"}],"dist":{"shasum":"f5957c429c5214ebd77f917ef10e8cf615b2419c","tarball":"https://registry.npmjs.org/bomb/-/bomb-1.3.1.tgz","integrity":"sha512-KKLKEgSXE1RleL4134uYkDSCTVAnFjiFSLvO0Lfkt2RKFYl1U84hkCFxcibD4Dqyo/2VuiVxxNQkaIqns8ctDw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD8fs6TIa1Iq2Kz4WOoEPA90y+UDh0Bn7UpbL19B1kglQIhAKyVlW8iPJQZUH0Qrrvz/prahA/NlCXqo8/TMfu+9S2C"}]}},"1.4.0":{"name":"bomb","version":"1.4.0","description":"A frontend cache-busting static middleware for express","main":"index.js","directories":{"example":"examples"},"scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"https://github.com/mtharrison/bomb.git"},"author":{"name":"Matt Harrison","email":"hi@matt-harrison.com"},"license":"MIT","bugs":{"url":"https://github.com/mtharrison/bomb/issues"},"homepage":"https://github.com/mtharrison/bomb","devDependencies":{"express":"^4.12.3"},"dependencies":{"MD5":"^1.2.1","joi":"^6.0.8","mime":"^1.3.4","send":"^0.12.2","wrench":"^1.5.8"},"gitHead":"7e0f3235ee37268f834e5d704a04a5b253cccc67","_id":"bomb@1.4.0","_shasum":"d3983d057059ec10171f47806c43c77510829f8c","_from":".","_npmVersion":"1.4.28","_npmUser":{"name":"mtharrison","email":"hi@matt-harrison.com"},"maintainers":[{"name":"mtharrison","email":"hi@matt-harrison.com"}],"dist":{"shasum":"d3983d057059ec10171f47806c43c77510829f8c","tarball":"https://registry.npmjs.org/bomb/-/bomb-1.4.0.tgz","integrity":"sha512-aT+vi+BhslpgGvXQOYO//vKD/ihig3oe3d0RU+hnM+l58Ggz6wvpEd0pIqDB1581yHv6Cj27+JPFP5cOFnt3xQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFmZlFnxsI+SDhHBEhyfPPgtkpWc5SEphZTBkU2axPMqAiBg6Pn4yzDwPKk+A4kXic7sNIggg3T6OOTngPFa6CCFwQ=="}]}},"1.5.0":{"name":"bomb","version":"1.5.0","description":"A frontend cache-busting static middleware for express","main":"index.js","directories":{"example":"examples"},"scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"https://github.com/mtharrison/bomb.git"},"author":{"name":"Matt Harrison","email":"hi@matt-harrison.com"},"license":"MIT","bugs":{"url":"https://github.com/mtharrison/bomb/issues"},"homepage":"https://github.com/mtharrison/bomb","devDependencies":{"express":"^4.12.3"},"dependencies":{"MD5":"^1.2.1","joi":"^6.0.8","mime":"^1.3.4","send":"^0.12.2","wrench":"^1.5.8"},"gitHead":"b7445295173bcaaf4a575afffad71d4b2c914534","_id":"bomb@1.5.0","_shasum":"f0c0d7c790c6049824cc4b1e61f6d553dfb1b4b5","_from":".","_npmVersion":"1.4.28","_npmUser":{"name":"mtharrison","email":"hi@matt-harrison.com"},"maintainers":[{"name":"mtharrison","email":"hi@matt-harrison.com"}],"dist":{"shasum":"f0c0d7c790c6049824cc4b1e61f6d553dfb1b4b5","tarball":"https://registry.npmjs.org/bomb/-/bomb-1.5.0.tgz","integrity":"sha512-y9evKwZOyst8XvUobYzg/zKROv86Y7ZITz6krDeBN6kHiuQwtqTZuDhWuS0KKhAXpSy9kMsgrjPLmrDWlDCsUA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBCbMwLLmxFPw5Ji2IudSe4xwe5uRRc5MLlrbEocAfUNAiBuGX/JrAvVFCigOQOO470qShrBz3sbMKDN34SxF5D6Tg=="}]}}},"homepage":"https://github.com/mtharrison/bomb","repository":{"type":"git","url":"https://github.com/mtharrison/bomb.git"},"author":{"name":"Matt Harrison","email":"hi@matt-harrison.com"},"bugs":{"url":"https://github.com/mtharrison/bomb/issues"},"license":"MIT","readmeFilename":"README.md"}