{"_id":"@adam-lynch/sirv-cli","_rev":"3-fb8260b83ca53f023020677ab460db6e","name":"@adam-lynch/sirv-cli","dist-tags":{"beta":"1.0.9-0","latest":"1.0.9-2"},"versions":{"1.0.9-0":{"name":"@adam-lynch/sirv-cli","version":"1.0.9-0","description":"A lightweight CLI program to serve static sites~!","repository":{"type":"git","url":"git+https://github.com/lukeed/sirv.git"},"main":"index.js","license":"MIT","bin":{"sirv":"bin.js"},"author":{"name":"Luke Edwards","email":"luke@lukeed.com","url":"https://lukeed.com"},"engines":{"node":">= 10"},"dependencies":{"console-clear":"^1.1.0","get-port":"^3.2.0","kleur":"^3.0.0","local-access":"^1.0.1","sade":"^1.6.0","semiver":"^1.0.0","sirv":"^1.0.7","tinydate":"^1.0.0"},"bugs":{"url":"https://github.com/lukeed/sirv/issues"},"homepage":"https://github.com/lukeed/sirv#readme","_id":"@adam-lynch/sirv-cli@1.0.9-0","_nodeVersion":"12.16.1","_npmVersion":"6.13.4","dist":{"integrity":"sha512-MqzGL8OBwjHggWv9PPB5szxpxDAXPg+7fZzrU/D4dAmO3aM3ahYTsaWDw4NOrNThVJxATCbZ9KVGmFSwnS0FIw==","shasum":"e73e997c48deb1ca8d88ab81f0b79a87e92b33d3","tarball":"https://registry.npmjs.org/@adam-lynch/sirv-cli/-/sirv-cli-1.0.9-0.tgz","fileCount":4,"unpackedSize":11741,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfwK4mCRA9TVsSAnZWagAATpYP/2sAyOZVlJlZDxyoArW4\n+XATCF52Fes6BgD9Y1SzF3hMV67ZY4S/8hEJt2BYF/R97uxdzR1mf8HK0vPr\nTK3WtwIfFWzbmLJh1f5j14tOA1qhgJn8Hc5TXgBoHljGkgF6z9jhdUw8rsHF\nXzd0VBMkb4cokI4aXHlsTBuO9XjWRkjPm7cIvnKwdNq63iW2aPHmAtGrPTU0\nj+cxVS3PK7eOW5Jdk4v71CQ6MCIbRaPdj8/ysO+90ZlxKKhDgeB7nWfgbj3B\no2cogs2pd96cAV2BSxdmUWTYoBnvst94mIG3UHwAjqVoX4iVQzZapVnEL482\nb2AuRW4SVKnF1PRrzPzneABUukmCmso77Qn7qJeR7RT063EbfxXYLuQtfqzi\nWMe42/Uj581/QnkOtpDXzdFInzzbLpSNavz2ib9A5zefeO7YxgvhqU0tKUcb\n4E3IIDRS8AHnmK0m8Miz1ZMkdHVMDgnvf3gY6OIpKKehdnmT7UZ8gbRIC3Oq\nNw1D+l+V9VUnkVxo3vMW8lOcGQK7FfCOnVh8pinfmyrdnPVtR2huzQHnS+tg\nX+U64/Ws7N0e4c+H4UrFr/QFqwyn9uMtHQ/8F14S+WYVG6eMO/4ZgCBBOFS/\nWFQixGHRMlvTBDFop3ERQfW5YQyIUOXVM57bSH52GodI9No7wAEjICBajDke\n7QMx\r\n=xLV8\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDOdA5xqOmJ7stSVjObFcknXL60QuHFMaxT64mh7nhWGAiADbA+6DuTOcBU3fojZTw9oSxhzU4IocxG4BKCU2NO5qQ=="}]},"_npmUser":{"name":"adam-lynch","email":"contact@adamlynch.ie"},"directories":{},"maintainers":[{"name":"adam-lynch","email":"contact@adamlynch.ie"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/sirv-cli_1.0.9-0_1606463013531_0.274942337887607"},"_hasShrinkwrap":false},"1.0.9-1":{"name":"@adam-lynch/sirv-cli","version":"1.0.9-1","description":"A lightweight CLI program to serve static sites~!","repository":{"type":"git","url":"git+https://github.com/lukeed/sirv.git"},"main":"index.js","license":"MIT","bin":{"sirv":"bin.js"},"author":{"name":"Luke Edwards","email":"luke@lukeed.com","url":"https://lukeed.com"},"engines":{"node":">= 10"},"dependencies":{"console-clear":"^1.1.0","get-port":"^3.2.0","kleur":"^3.0.0","local-access":"^1.0.1","sade":"^1.6.0","semiver":"^1.0.0","sirv":"^1.0.8-0","tinydate":"^1.0.0"},"bugs":{"url":"https://github.com/lukeed/sirv/issues"},"homepage":"https://github.com/lukeed/sirv#readme","_id":"@adam-lynch/sirv-cli@1.0.9-1","_nodeVersion":"12.16.1","_npmVersion":"6.13.4","dist":{"integrity":"sha512-CSEKStm0wYRQzIvMCEDDHIolAzCfxgK8BaKOjecI4eE/uD5XZipBBZ9OkHZJpeqDs/BOSYm+Pd0se4e3YhaGuA==","shasum":"d1c426bfbebc184c522553421e11b89bed8f557b","tarball":"https://registry.npmjs.org/@adam-lynch/sirv-cli/-/sirv-cli-1.0.9-1.tgz","fileCount":4,"unpackedSize":11743,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfwK/NCRA9TVsSAnZWagAArUMP/RHAbHQ8ryxVcXOSAlAr\nWpjzRJJmZTaY7iXbCqa1bcKZhSR3eVbe+a8oDdgC+rAdOrPDqPhtNih4miva\n3BJjXD6zzkr2htdbmRHbYeRLQeXbMGr6v2iwXintIldTFUmRHWyWXiITzQqV\nwo0aOJsptVi/4LDYz6YxIEz92tiGLDiRAvrq7fP+B+8bDstHVEXR6OXBD+jP\nON1uq+mqS+BHpCSkpO5YlssABfl34RKu30+in0stL9yGeghQSGzOZUTUPL9K\ntHptBtuwpjd76TAHMJyrulpguKnnj0Li7Xk+cXCxrI6gZMXOge6tnPCJfsG6\nucdo3XfVTM6zr4iznB5hAu/AhUBDHGYmfOureox95GMJ9WXxXh6kkRhrXWPZ\nEiWCfTl1TmxiJXGix2xSvf1uNeaZ5chCUC+GQjuf3XVrW8O8Q0EDxvrBfwoA\nnfFxzlRF/x+tzlV+zuJfCVI1BJ+Tf34gI7lbfzuHzsDPTELiD6ZhjYmUMANC\nPlkDndo7/LDsqsvWJIgWdmWMzti3wublGqAMe5WCVkTwrA6xgQ5OKrPb9HeH\nzi+uNozA6kVKj2CbdnKQpJCOG3/hs/zIPOzONPNJyxcnmCya9OiI41pGvJoX\nOFm8k6P6sgM8kY7KOttU94sHyHA0EcNjn4kfeYJCvlrykJ1y/ki0XTpKo/EQ\nr1tX\r\n=hMRK\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICFnXbXGI48moNzzygjaj3eEGaRUzHwllooCxBDDW+AeAiB2yKFiChWkjBWhvgNdRZ/8TxGz7eUJUlxfKgixkdvuzQ=="}]},"_npmUser":{"name":"adam-lynch","email":"contact@adamlynch.ie"},"directories":{},"maintainers":[{"name":"adam-lynch","email":"contact@adamlynch.ie"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/sirv-cli_1.0.9-1_1606463436707_0.5620161062658908"},"_hasShrinkwrap":false},"1.0.9-2":{"name":"@adam-lynch/sirv-cli","version":"1.0.9-2","description":"A lightweight CLI program to serve static sites~!","repository":{"type":"git","url":"git+https://github.com/lukeed/sirv.git"},"main":"index.js","license":"MIT","bin":{"sirv":"bin.js"},"author":{"name":"Luke Edwards","email":"luke@lukeed.com","url":"https://lukeed.com"},"engines":{"node":">= 10"},"dependencies":{"console-clear":"^1.1.0","get-port":"^3.2.0","kleur":"^3.0.0","local-access":"^1.0.1","sade":"^1.6.0","semiver":"^1.0.0","@adam-lynch/sirv":"^1.0.8-0","tinydate":"^1.0.0"},"bugs":{"url":"https://github.com/lukeed/sirv/issues"},"homepage":"https://github.com/lukeed/sirv#readme","_id":"@adam-lynch/sirv-cli@1.0.9-2","_nodeVersion":"12.16.1","_npmVersion":"6.13.4","dist":{"integrity":"sha512-5N1kErnuXfE0an6rMg9AnNfiPQXVfOXFt5jRjvEuRi7byb7ZEWXkT+xescV432DLQnn7+ZzIUyNWdbY6GPfnwA==","shasum":"053e74b01de513cd37321a02297bef5a317e125d","tarball":"https://registry.npmjs.org/@adam-lynch/sirv-cli/-/sirv-cli-1.0.9-2.tgz","fileCount":4,"unpackedSize":11767,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfwLAdCRA9TVsSAnZWagAAiLcP/iqJE1UUCWuXLcBVvWQO\nZeS5PCatCxrtWNCQy8zgQNdzf+1RgUy92fWOUicTlm42wI/ykERi3XqCQD7Y\ng73nr8Mbio5QuiT46Zoj2SjHOnDkMROAyPjO12Vv6BnGtB+PzxdiEBG7CJdR\nXcgaZbzOf/k7Vma3nro/y0R69oowxp+lHzJtJMc7VDohs/krmTvtEy2Ic1um\nA4gEKseyp5tzwI3vtyXiwUrMFfXMZUZKkjXcxmVA7OgXH2bogkygrwcfbOGc\nkbhyBj9iwuxYuw9MyQ1+Z2gCxgLSMnO3vkwl1CubPjFyTkxN42hLubDksovu\n0zkBAIQgIFbakX9fqz+aoZphdtk+744XRsq7vEkwDhHuY9hj1bF+kOSSqOg8\npZh5uXX9OiF612ViMGmTxNKRsAIDOJ/7FUrLXwMQUCFnR5ASXAGzJhdITrwg\nTDlmIcBSLfasnZrFJQlnxTiYg8iE6vkXqVX6KsBRJU4d5b3ADby7+QkxexVx\nZI/OKGZxTvQqFMKAGCr0Dtsc1/ofHwLAFVVO1qPKCd/p5f61fUXTiiQw2cvT\nXhr30eI6O+jOnmjuEzJEIcw3Gr/ES4vYMmvKfBsgl7L1YtO/UW5O7YG1P6Kd\n/H0H21TyY/lV5wu9H2i5eMmW8sAtGmqFx4xqy+nkNUt+ciS/960ibkfX1dlp\n/zRA\r\n=Dn0M\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDh2DveaZBLaJlGg4QNWUU4YpxhXnMjy02lrExVMBSlfQIhAIAjxKw71VetdFuht7zcHVYwD98tq+gyaMkehdDbs7cp"}]},"_npmUser":{"name":"adam-lynch","email":"contact@adamlynch.ie"},"directories":{},"maintainers":[{"name":"adam-lynch","email":"contact@adamlynch.ie"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/sirv-cli_1.0.9-2_1606463517267_0.23423072770038056"},"_hasShrinkwrap":false}},"time":{"created":"2020-11-27T07:43:33.531Z","1.0.9-0":"2020-11-27T07:43:33.713Z","modified":"2022-04-04T11:24:55.170Z","1.0.9-1":"2020-11-27T07:50:36.834Z","1.0.9-2":"2020-11-27T07:51:57.373Z"},"maintainers":[{"name":"adam-lynch","email":"contact@adamlynch.ie"}],"description":"A lightweight CLI program to serve static sites~!","homepage":"https://github.com/lukeed/sirv#readme","repository":{"type":"git","url":"git+https://github.com/lukeed/sirv.git"},"author":{"name":"Luke Edwards","email":"luke@lukeed.com","url":"https://lukeed.com"},"bugs":{"url":"https://github.com/lukeed/sirv/issues"},"license":"MIT","readme":"<div align=\"center\">\n  <img src=\"https://github.com/lukeed/sirv/raw/master/sirv-cli.png\" alt=\"sirv-cli\" width=\"350\" />\n</div>\n\n<h1 align=\"center\">sirv-cli</h1>\n\n<div align=\"center\">\n  <a href=\"https://npmjs.org/package/sirv-cli\">\n    <img src=\"https://img.shields.io/npm/v/sirv-cli.svg\" alt=\"version\" />\n  </a>\n  <a href=\"https://github.com/lukeed/sirv/actions?query=workflow%3ACI+branch%3Anext\">\n    <img src=\"https://github.com/lukeed/sirv/workflows/CI/badge.svg\" alt=\"CI\" />\n  </a>\n  <a href=\"https://npmjs.org/package/sirv-cli\">\n    <img src=\"https://img.shields.io/npm/dm/sirv-cli.svg\" alt=\"downloads\" />\n  </a>\n</div>\n\n<div align=\"center\">A lightweight CLI program to serve static sites~!</div>\n\n<br />\n\nQuickly start a server to preview the assets of _any_ directory!\n\n\n## Install\n\n```\n$ npm install --save sirv-cli\n```\n\n> **Note:** This module can also be installed and used globally~!\n\n## Usage\n\n> **Important:** The `HOST` and `PORT` environment variables will override the `--host` and `--port` flags, respectively.\n\n```\n$ sirv --help\n\n  Description\n    Run a static file server\n\n  Usage\n    $ sirv [dir] [options]\n\n  Options\n    -D, --dev          Enable \"dev\" mode\n    -e, --etag         Enable \"ETag\" header\n    -d, --dotfiles     Enable dotfile asset requests\n    -c, --cors         Enable \"CORS\" headers to allow any origin requestor\n    -G, --gzip         Send precompiled \"*.gz\" files when \"gzip\" is supported  (default true)\n    -B, --brotli       Send precompiled \"*.br\" files when \"brotli\" is supported  (default true)\n    -m, --maxage       Enable \"Cache-Control\" header & define its \"max-age\" value (sec)\n    -i, --immutable    Enable the \"immutable\" directive for \"Cache-Control\" header\n    -k, --http2        Enable the HTTP/2 protocol. Requires Node.js 8.4.0+\n    -C, --cert         Path to certificate file for HTTP/2 server\n    -K, --key          Path to certificate key for HTTP/2 server\n    -P, --pass         Passphrase to decrypt a certificate key\n    -s, --single       Serve as single-page application with \"index.html\" fallback\n    -I, --ignores      Any URL pattern(s) to ignore \"index.html\" assumptions\n    -q, --quiet        Disable logging to terminal\n    -H, --host         Hostname to bind  (default localhost)\n    -p, --port         Port to bind  (default 5000)\n    -v, --version      Displays current version\n    -h, --help         Displays this message\n\n  Examples\n    $ sirv build --cors --port 8080\n    $ sirv public --quiet --etag --maxage 31536000 --immutable\n    $ sirv public --http2 --key priv.pem --cert cert.pem\n    $ sirv public -qeim 31536000\n    $ sirv --port 8080 --etag\n    $ sirv --host --dev\n\n```\n\n## Network Access\n\nFor security reasons, `sirv-cli` **does not** expose your server to the network by default.\nThis means that your machine, _and only your machine_, will be able to access the `localhost` server.\n\nIf, however, your coworker wants to access the server from their computer, or you want to preview your work on a mobile device, you must use the `--host` flag. Only _then_ will your server be accessible to other devices on the same network.\n\nUsing `--host` without a value is equivalent to `--host 0.0.0.0`, which is makes it discoverable publicly. You may customize this by passing a different value – but you probably don't need to!\n\n> **Important:** Only the `Network:` address is accessible to others. The `Local:` address is still private to you.\n\n\n## HTTP/2\n\n> **Note:** Requires Node.js v8.4.0 or later.\n\nThe `--key` and `--cert` flags are required since no browsers support [unencrypted HTTP/2](https://http2.github.io/faq/#does-http2-require-encryption).<br>These must be valid file paths (resolved from `process.cwd()`), which are read and passed into [`http2.createSecureServer`](https://nodejs.org/api/http2.html#http2_http2_createsecureserver_options_onrequesthandler).\n\nYou can generate a certificate and key for local development quickly with:\n\n```sh\n$ openssl req -x509 -newkey rsa:2048 -nodes -sha256 -subj '/CN=localhost' \\\n  -keyout localhost-key.pem -out localhost-cert.pem\n\n# Now we can run a HTTP/2 server\n$ sirv --http2 --key localhost-key.pem --cert localhost-cert.pem\n```\n\nTo bypass the \"third party verification\" error page, you may use [`mkcert`](https://github.com/FiloSottile/mkcert) to generate a locally-trusted development certificate:\n\n```sh\n$ mkcert -install\n$ mkcert -key-file localhost-key.pem -cert-file localhost-cert.pem localhost 127.0.0.1\n\n# Now we can run a HTTP/2 server with verified SSL\n$ sirv --http2 --key localhost-key.pem --cert localhost-cert.pem\n```\n\n\n## Single Page Applications\n\nYou must pass the `--single` flag to enable single-page application (\"SPA\") mode. This will, for example, serve your directory's `index.html` file when an unknown _path_ (eg; `/foo/bar`) does not resolve to another page.\n\n> **Note:** Please refer to [`opts.single`](https://github.com/lukeed/sirv/tree/master/packages/sirv#optssingle) for the lookup sequence.\n\nAny asset requests (URLs that end with an extension) ignore `--single` behavior and will send a `404` response instead of the \"index.html\" fallback. To ignore additional paths, pass URL patterns to the `--ignores` argument.\n\n```sh\n# Don't include \"/blog*\" or \"/portfolio*\" pages into SPA\n$ sirv public --single --ignores \"^/blog\" --ignores \"^/portfolio\"\n```\n\nYou may pass a string to customize which file should be sent as fallback.<br>In other words, `--single shell.html` will send the directory's `shell.html` file instead of its `index.html` file.\n\n\n## Production\n\nWhen using `sirv-cli` for production file-serving, you should:\n\n1) Ensure `--dev` is not used\n2) Enable HTTP/2 (`--http2`) with valid key and cert\n3) Precompile brotli and/or gzip file variants\n4) Enable `--gzip` and/or `--brotli` flags\n\nFor maximum performance, you should also use `--quiet` to disable the I/O from logging.\n\n> **Notice:**<br>\nWhile `sirv-cli` is certainly \"production ready\", using a CDN in production is always recommended.<br>\nEspecially when performance is a concern, there are much better solutions than using Node.js as a file server.<br>\nMost everything has HTTP/2 and \"SPA\" support nowadays – consider NGINX or [h2o](https://h2o.examp1e.net/).\n\n## License\n\nMIT © [Luke Edwards](https://lukeed.com)\n","readmeFilename":"readme.md"}