{"_id":"@frangio/servbot","_rev":"4-e14e4e55970913e60856d38026ebd14a","name":"@frangio/servbot","dist-tags":{"latest":"0.3.0-1","next":"0.3.0-0"},"versions":{"0.2.4":{"name":"@frangio/servbot","version":"0.2.4","keywords":["servor","server","http","https","localhost"],"author":{"name":"kevinfiol"},"license":"MIT","_id":"@frangio/servbot@0.2.4","maintainers":[{"name":"frangio","email":"frangio.1@gmail.com"}],"homepage":"https://github.com/kevinfiol/servbot#readme","bugs":{"url":"https://github.com/kevinfiol/servbot/issues"},"dist":{"shasum":"ae55ef8210b9b7b7722bc66d12b326b48534356d","tarball":"https://registry.npmjs.org/@frangio/servbot/-/servbot-0.2.4.tgz","fileCount":5,"integrity":"sha512-I71kYyOR925A1DErs6ANtN/2G6dpSrKr5eOlf0qD1y4eIQV+NQmEfzp6TyjDIadJJPGzQYalxcbnY/59W4vXtg==","signatures":[{"sig":"MEQCIFA/17UYJhsCvJoZMBq9AAzOpX/NljSzIBHEyjTkYIcrAiArJVNZTuXTrGsb5pXiAqlaadaGPKIlmNmDV3V/7oVMEw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":20571,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjJhL+ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmqr7g//UTOYjtWENV7OkdvL/Vuvtqjh0zvtSgE0dN1ON2M/L9BB1o5H\r\nZI6qUjpv1+e+e9eTU2cEHfsCf6cTeYVCH+XrVYebMtXJhW+AG8PDKDQvabTI\r\nuLQpLHMitLz0yHsxAjccBLQQlbsGl5k2Q5taxuo783JI1BPgNQ4YzBTqOUYS\r\nGvfyTgX3j6U8sxVvI0KCo8l2JYSmoVvPNL710/w35/m2pcm/h1XMg45ExqNo\r\nyPQBHGj97n8BYKF84HbTWJzjkQu0e4hsIgSJsoresbuM2R7Qs/60uhlWaRvF\r\nCoKFWu8UWzRUf9gSuledTKn/kPpDThL0/fEctKzSzHrf06kPNfgiBhA3Ex1M\r\nzsE9dJA4U1ubztr0A9FrR8BUiqqnpeamt4cKJRN2uevzZZ77woGMTqYYcbJd\r\nMqiOdaA8lz7c4RgrsDwXrFdvt1f2+jAv3J5U2ahHffuW3wJw5iqByoQxtR3h\r\niluVSREvMNiMwyQ1gJPzOk48aFAQ5lWz6KZFjD0pFOdcS3xjKrUYzQ1efNCZ\r\nC5QryuX3KH5I38i+J4IjXaezQ+i+8ZFDGRdLFmeWx463XWUjBa91GEYU4zIK\r\ne2zxlQsFogq+G9gjdteZ551P7mO/w+ltAX1ZqTOhIXsOwSMBPO8TTj6i3+77\r\n97414jRTVVwCleYJpBh5HNgzHstaFbSN+LA=\r\n=CHuZ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/servbot.cjs","type":"module","types":"index.d.ts","module":"index.js","engines":{"node":">=12.x","pnpm":"7.5.1"},"gitHead":"110e21f0b0c6f95663090dd7fc41b4796947b659","scripts":{"spa":"node ./scripts/runSpaExample.js","test":"node test.js","build":"node ./scripts/transpile.js","static":"node ./scripts/runStaticExample.js"},"_npmUser":{"name":"frangio","email":"frangio.1@gmail.com"},"umd:name":"servbot","repository":{"url":"git+https://github.com/kevinfiol/servbot.git","type":"git"},"_npmVersion":"8.19.1","description":"A small dev server script for local static site development","directories":{},"_nodeVersion":"18.9.0","_hasShrinkwrap":false,"devDependencies":{"flitch":"^0.6.3","dedent-js":"^1.0.1","watchlist":"^0.3.1"},"_npmOperationalInternal":{"tmp":"tmp/servbot_0.2.4_1663439613951_0.21188559770481574","host":"s3://npm-registry-packages"}},"0.2.5":{"name":"@frangio/servbot","version":"0.2.5","keywords":["servor","server","http","https","localhost"],"author":{"name":"kevinfiol"},"license":"MIT","_id":"@frangio/servbot@0.2.5","maintainers":[{"name":"frangio","email":"frangio.1@gmail.com"}],"homepage":"https://github.com/kevinfiol/servbot#readme","bugs":{"url":"https://github.com/kevinfiol/servbot/issues"},"dist":{"shasum":"d4524c15c8a34fcdde36037b84407c4c60b4cf16","tarball":"https://registry.npmjs.org/@frangio/servbot/-/servbot-0.2.5.tgz","fileCount":6,"integrity":"sha512-ogja4iAPZ1VwM5MU3C1ZhB88358F0PGbmSTGOkIZwOyLaDoMHIqOVCnavHjR7DV5h+oAI4Z4KDqlam3myQUrmg==","signatures":[{"sig":"MEQCIBrWNC8hazqHGsb/1OaovCmh3+IgVSKRJNZtrZX0Fd7mAiB895roBKbAUduCGlh2gthAeemcD9Eg9+7n0PYLaULYsA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":37663,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjJhbYACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmoz/xAAksV1wIIKaA/n428MTcN+mNXrW6ZwwJbmaQWsVdTsBEmfIK6h\r\nrZyC4LUa3z4KhnAUFrTmn+p5ywWY419Ps1gIrya6iygscsO91mSPGhy2y/MA\r\naOwH/PzLZWT2R9LPSYmPFW6ggT7pu49C6qBRfxGCjivPv5bsS5zgAS4glEbj\r\njvPPSHh/7s7sAcL24wFtm5EobOh1l7BMPl0mdhtsv+G7uBn4cJMRGU/ba/+i\r\n9WeQOWNEgRzdF409ZghsFAQHuCsSk9v38vVSyn8ujeHYYN7XbNz80HHwqGth\r\navnIoC6vFxWHJa1+hM+wVntSeEn26d2Hp/1wVdA0KGJFkhCJnw53nAKMZWz9\r\njeOp9XUDjLDht+JwNvziK9VEdZYe+jm3TgseMxvRQSYTgfFTiF2FU8BmU5eV\r\nVcXxPk4cwNncQ+6XCNmtavWSCGCGyAXvySiGhsTdLcIraa1z36K5qZeHqYuo\r\nLDP7IBabcxmuLQFSezhxXOxeP4RWoP+GvAKcrnUp2Sqk0eKr4aHgZL4cDgl0\r\nVJiYSHrebYWcMVf1ofQ9p5XESFH5I30qMD0OyhAfGDVB+7sEsrjzfXxOr3Oq\r\nTGyt5BvSn5xmZNUJ+FGS5sr74qgYXeqP7w5UFJvsCfvPpU51vExPxc3bl5FJ\r\nb62ip+1ixRo6DfMbu1tYK4YeiY+dmtMzFDs=\r\n=kCkv\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/servbot.cjs","type":"module","types":"index.d.ts","module":"index.js","engines":{"node":">=12.x","pnpm":"7.5.1"},"gitHead":"4b7825051aaa3f7076976b4b8335cc63f2c1cf2a","scripts":{"spa":"node ./scripts/runSpaExample.js","test":"node test.js","static":"node ./scripts/runStaticExample.js","prepare":"esbuild index.js --platform=node --format=cjs --outfile=dist/servbot.cjs"},"_npmUser":{"name":"frangio","email":"frangio.1@gmail.com"},"umd:name":"servbot","repository":{"url":"git+https://github.com/kevinfiol/servbot.git","type":"git"},"_npmVersion":"8.19.1","description":"A small dev server script for local static site development","directories":{},"_nodeVersion":"18.9.0","_hasShrinkwrap":false,"devDependencies":{"flitch":"^0.6.3","esbuild":"^0.15.7","dedent-js":"^1.0.1","watchlist":"^0.3.1"},"_npmOperationalInternal":{"tmp":"tmp/servbot_0.2.5_1663440599887_0.022906490964994308","host":"s3://npm-registry-packages"}},"0.3.0-0":{"name":"@frangio/servbot","version":"0.3.0-0","keywords":["servor","server","http","https","localhost"],"author":{"name":"kevinfiol"},"license":"MIT","_id":"@frangio/servbot@0.3.0-0","maintainers":[{"name":"frangio","email":"frangio.1@gmail.com"}],"homepage":"https://github.com/kevinfiol/servbot#readme","bugs":{"url":"https://github.com/kevinfiol/servbot/issues"},"dist":{"shasum":"213ee8760fe175f3ef9941b662e11b81ac181e1f","tarball":"https://registry.npmjs.org/@frangio/servbot/-/servbot-0.3.0-0.tgz","fileCount":6,"integrity":"sha512-UKqtEOMKjFHzmnxDWZlqaPRJjFWZmKBhAfttBt4gkguQ8WSL/qZpxKYY32c6UvcaCslx0Y6M4VSerMBlz3lwfw==","signatures":[{"sig":"MEUCIQDlLRntndoOLbRpizXosSWupoDAOgj+0wvbyBQ7Ha8waQIgSJTIpHSLBl3ejsK77wpxv0wfDGXJMgfll9iQfQp97tE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":35181,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjYfA0ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrUiQ//RjPCbQLq5RYGagKQ7cQVsEhV5pPsKfn8+7URoLrZYRebXMg/\r\naWJP8B4hon01tc9YBeK1ml7v4TxtPipLRSkfyUfhrnJaxRsl53TsXWyHpZN9\r\nH60acqtbAsXs5YAQjzj2RUGNoL2sjcCDIzn2t1CstVJo8C++L4QAtCb1EkMM\r\nOO/0951c0vxTGu+9ueMqXrhFELJj/JnkptaFNOSjjR9oAhWIq8ll/50/MGXF\r\ngS/esSwBgqqlHG4N73x/KrXyIyihUDe6jSktRbDPW7K9NFi+VyjB0U0ZB5V6\r\nfBI5xYZMND0EEVH98SeLmjuNF+YZxvjS3hzsWVPZfIPGIi+aR8sbIoAlzlhs\r\n1liW6hgvG5ay3p7xwYItO2gg1sKGKFAYqUNWtbXaZk/XfisIX0RLgDkgZhlw\r\ndBjf2EEDVGwoNspjFK2IFn1oujnTEyX2RutH0Argl6D/G6s/gCnRgZqypvbD\r\nkBAFabqDkTAQi+YLGpz54nP0GYO+DtPRRnU1t4FFq+IWb5JcKveWhzfesfKB\r\nB3wUvsKc97D4dl3KMmNesLbal3tGxvhSGm0iwEstJNco6Dozttdfhoy/qOAe\r\niaLbe1Qb/xz7+AXiPTGlvYIa4SdzMP7V+srOCxcbapM5R7KzgiseyvePpOGK\r\nz/iBHetN/mJGQBBMVvkmIvJyhXIO7t6AYL0=\r\n=W82F\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/servbot.cjs","type":"module","_from":"file:frangio-servbot-0.3.0-0.tgz","types":"index.d.ts","module":"index.js","engines":{"node":">=12.x","pnpm":"7.x"},"scripts":{"spa":"node ./scripts/runSpaExample.js","test":"node test.js","static":"node ./scripts/runStaticExample.js"},"_npmUser":{"name":"frangio","email":"frangio.1@gmail.com"},"umd:name":"servbot","_resolved":"/tmp/9278de3ac2d27805513617c855806bee/frangio-servbot-0.3.0-0.tgz","_integrity":"sha512-UKqtEOMKjFHzmnxDWZlqaPRJjFWZmKBhAfttBt4gkguQ8WSL/qZpxKYY32c6UvcaCslx0Y6M4VSerMBlz3lwfw==","repository":{"url":"git+https://github.com/kevinfiol/servbot.git","type":"git"},"_npmVersion":"8.19.2","description":"A small dev server script for local static site development","directories":{},"_nodeVersion":"16.18.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"flitch":"^0.6.3","dedent-js":"^1.0.1","watchlist":"^0.3.1"},"_npmOperationalInternal":{"tmp":"tmp/servbot_0.3.0-0_1667362867909_0.3647210155337304","host":"s3://npm-registry-packages"}},"0.3.0-1":{"name":"@frangio/servbot","version":"0.3.0-1","author":{"name":"kevinfiol"},"license":"MIT","description":"A small dev server script for local static site development","type":"module","repository":{"type":"git","url":"git+https://github.com/kevinfiol/servbot.git"},"main":"dist/servbot.cjs","module":"index.js","types":"index.d.ts","umd:name":"servbot","engines":{"node":">=12.x","pnpm":"10.x"},"keywords":["servor","server","http","https","localhost"],"devDependencies":{"dedent-js":"^1.0.1","flitch":"^0.6.3","watchlist":"^0.3.1"},"scripts":{"static":"node ./scripts/runStaticExample.js","spa":"node ./scripts/runSpaExample.js","test":"node test.js"},"_id":"@frangio/servbot@0.3.0-1","bugs":{"url":"https://github.com/kevinfiol/servbot/issues"},"homepage":"https://github.com/kevinfiol/servbot#readme","_integrity":"sha512-eKXRqt8Zh3aqtVYoyayuLiktcW6vnYCuwlcqg91cv3HSdM5foTmIECJEJiwI+GBmSLY37mzczpt/ZfvYqzrQWQ==","_resolved":"/tmp/e90183b8eefb05ceccc4f95af36d65d9/frangio-servbot-0.3.0-1.tgz","_from":"file:frangio-servbot-0.3.0-1.tgz","_nodeVersion":"22.16.0","_npmVersion":"10.9.2","dist":{"integrity":"sha512-eKXRqt8Zh3aqtVYoyayuLiktcW6vnYCuwlcqg91cv3HSdM5foTmIECJEJiwI+GBmSLY37mzczpt/ZfvYqzrQWQ==","shasum":"fb8ed82c2a9351e625199fc428146a01fc88a942","tarball":"https://registry.npmjs.org/@frangio/servbot/-/servbot-0.3.0-1.tgz","fileCount":6,"unpackedSize":35244,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIBb1qgNpxnXd27Sm1ODzJYKTupApTf8l7QJTHpdQYAStAiBOURBumM1IPmd4LYWgQsN7r6CTXRJns5UxeBFLup19rw=="}]},"_npmUser":{"name":"frangio","email":"frangio.1@gmail.com"},"directories":{},"maintainers":[{"name":"frangio","email":"frangio.1@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/servbot_0.3.0-1_1749146149674_0.5882856139356758"},"_hasShrinkwrap":false}},"time":{"created":"2022-09-17T18:33:33.890Z","modified":"2025-06-05T17:55:50.006Z","0.2.4":"2022-09-17T18:33:34.153Z","0.2.5":"2022-09-17T18:50:00.052Z","0.3.0-0":"2022-11-02T04:21:08.099Z","0.3.0-1":"2025-06-05T17:55:49.844Z"},"bugs":{"url":"https://github.com/kevinfiol/servbot/issues"},"author":{"name":"kevinfiol"},"license":"MIT","homepage":"https://github.com/kevinfiol/servbot#readme","keywords":["servor","server","http","https","localhost"],"repository":{"type":"git","url":"git+https://github.com/kevinfiol/servbot.git"},"description":"A small dev server script for local static site development","maintainers":[{"name":"frangio","email":"frangio.1@gmail.com"}],"readme":"# servbot\n\nA small dev server for local static site development. Essentially a wrapper around [http.Server](https://nodejs.org/api/http.html#class-httpserver). Fork of [servor](https://github.com/lukejacksonn/servor).\n\n```js\nimport servbot from 'servbot';\n\nconst server = servbot({\n    root: './public/',\n    reload: true,\n    fallback: 'index.html'\n});\n\nserver.listen(8080);\n```\n\nThis is an opinionated fork with some intentional exclusions and smaller scope, and some ideas taken from [nativew/serve](https://github.com/nativew/serve).\n\n## Install\n\n```bash\nnpm install servbot --save-dev\n```\n\n## Usage\n\nSee types in [index.d.ts](/index.d.ts). servbot accepts a single argument, `ServbotOptions`; and returns an instance of `ServbotServer`. See below for the default options.\n\n```js\nimport servbot from 'servbot';\n\nconst server = servbot({\n    // root: string\n    // Directory to serve. Relative to process.cwd().\n    root: '.',\n\n    // reload: boolean\n    // Flag to enable manual reload.\n    reload: false,\n\n    // fallback: string\n    // Filename to fallback to for single-page applications. Relative to `root`.\n    // Leaving this empty assumes you are not serving a single-page application\n    fallback: '',\n\n    // ignores: RegExp[]\n    // *Only applicable when `fallback` is provided and `ignores` is not an empty array*.\n    // A list of patterns to *not* route to your fallback.\n    // Useful when you want to be able to route non-filetypes to your SPA (\"/foo/routename.hi\")\n    // But otherwise, want to \"ignore\" routes that should be static files (\"/main.css\", \"/js/jquery.js\")\n    ignores: [],\n\n    // credentials: object\n    // TLS Credentials. Providing these enables an HTTPS server.\n    // See https://nodejs.org/api/https.html#httpscreateserveroptions-requestlistener\n    credentials: undefined,\n\n    // verbose: boolean\n    // Flag to enable server response logging.\n    verbose: true\n});\n\n// Start server on port 8080\nserver.listen(8080);\n\n// Close server from new connections\n// https://nodejs.org/api/net.html#serverclosecallback\nserver.close((err) => {\n    if (err) process.exit();\n});\n```\n\n### Using manual reload\n\nInstead of including a filewatcher to automatically reload your app on file changes, servbot includes a *manual* reload feature. Most modern front-end development build tools already include a built-in watch feature (esbuild, rollup, webpack, parcel, etc.) that can be leveraged by servbot. For an example with [rollup](https://rollupjs.org/guide/en/), see [here](/example/rollup.config.js).\n\nOutside of build tools, you can also use something like [cheap-watch](https://github.com/Conduitry/cheap-watch) or [watchlist](https://github.com/lukeed/watchlist). See below for an example using watchlist:\n\n```js\nimport servbot from 'servbot';\nimport { watch } from 'watchlist';\n\nconst server = servbot({\n    root: './example/static/',\n    reload: true,\n    fallback: 'index.html'\n});\n\nserver.listen(8080);\n\n(async () => {\n    await watch(['./example/static/'], async () => {\n        console.log('change detected! reloading...');\n        server.reload();\n    });\n})();\n```\n\n## To-Do\n\n* Better tests for SPA example\n* HTTP/2 support\n","readmeFilename":"README.md"}