{"_id":"@azangru/with-express-graceful-shutdown","_rev":"2-1cd996d3b321c9e7be545900dca0e6fd","name":"@azangru/with-express-graceful-shutdown","dist-tags":{"latest":"0.0.2"},"versions":{"0.0.1":{"name":"@azangru/with-express-graceful-shutdown","version":"0.0.1","description":"Decorator for Express apps to enable graceful shutdown","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git+https://github.com/azangru/with-express-graceful-shutdown.git"},"keywords":[],"author":"","license":"ISC","devDependencies":{"eslint":"5.12.1"},"gitHead":"069735773a315e996d6761197a5f15e4616a394c","bugs":{"url":"https://github.com/azangru/with-express-graceful-shutdown/issues"},"homepage":"https://github.com/azangru/with-express-graceful-shutdown#readme","_id":"@azangru/with-express-graceful-shutdown@0.0.1","_nodeVersion":"10.13.0","_npmVersion":"6.6.0","dist":{"integrity":"sha512-KtvEYHtGZuwPszRVFvkpn3aKCaGefgIZ5TgqM28Xixrw6Y6xvqdvaXG6hJrRLRqOMFO4pqUKsJViKxlE5zo7Mg==","shasum":"e22294fea37855535014d0ab2caaff042ce51ec3","tarball":"https://registry.npmjs.org/@azangru/with-express-graceful-shutdown/-/with-express-graceful-shutdown-0.0.1.tgz","fileCount":3,"unpackedSize":3899,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcQ10HCRA9TVsSAnZWagAAQqoQAIp/6Gt9PwX7ssGveqcj\ntD4N1n6zpqQracmrP5ULdx6e3hnggUOEzXdRfvxVHaW5ES4/xfgetlGcmkF8\nNL3hmYxtlL75tY+/8HXqklHZn6tvaM0/E60Cb1PT2I5OERzHhw4NrsYjPdJo\nRhZR0HFEoEAHQY+rw7QnoAJvtuGfieZxx/sk0ZtKNxTVMSXlqzKexxCc8Yan\nxVACxNCD9lgj5FTUkbmM/+JCW35ze3q/VpR3g2u302JaFqgI2fYzm6AwEXWi\nB/Y4rq+ykmdum3ud0PXjBqJGRyDPaEzRXH8x1EHMCPZ9aFB6m/yDRUY4b3yH\n0R+qDnbmXkZlSNBhqy6r/KPVoG3sg8P/ainz0zPzGkWSrc3XwLm81+SiCbWS\ntu5BjtyiS0g8w62jciLdT/nVwlGup8osJIvDGCtx/QbQH7gAGEynHbwly+Q+\ncB0Se3v93N1H/A8e1Xv9xPd8CaBWr7+0+8cR0//6Ub0Li8m61pt024sMWnKE\n+yx5T3eCrxL88uFR//fqG/fcmDwItHwzLB6MdnZxR1/DjR5YvARuddQ9jCc6\nqnbSRVC+KX0oAUUXTWZ0MsqtT3wjZzjDp0olLy02WIqfEv7jhiyoRcmcfUd2\nRjQRuv0vio5CAV5jBJ7uzXzRSiA1xPkeMPOuriCxL/QLDBDtThUnvVKIDPWP\n/wOV\r\n=KRgW\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDZxg5sAoi/t61PjVOygpfhY/+uqOtOzw5sQfrw9U4nDQIhAMTQZ98RctsUF06VySWbFn1F06fsfJyX/OKKrqZBrP80"}]},"maintainers":[{"name":"azangru","email":"andrey.azov@gmail.com"}],"_npmUser":{"name":"azangru","email":"andrey.azov@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/with-express-graceful-shutdown_0.0.1_1547918598041_0.27590221076403143"},"_hasShrinkwrap":false},"0.0.2":{"name":"@azangru/with-express-graceful-shutdown","version":"0.0.2","description":"Decorator for Express apps to enable graceful shutdown","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git+https://github.com/azangru/with-express-graceful-shutdown.git"},"keywords":[],"author":"","license":"ISC","devDependencies":{"eslint":"5.12.1"},"gitHead":"63363b0e5b14b91c2051bf4cb9de9a86c6e7f366","bugs":{"url":"https://github.com/azangru/with-express-graceful-shutdown/issues"},"homepage":"https://github.com/azangru/with-express-graceful-shutdown#readme","_id":"@azangru/with-express-graceful-shutdown@0.0.2","_nodeVersion":"10.13.0","_npmVersion":"6.6.0","dist":{"integrity":"sha512-vyjKMc1YLbwMSrDAX+wq0T+d7yFHDzcEw1V5IWSPeswqjGlwdzwJc7MtqMZYjMVMusP9Hlr7yE8+GDXco1sYvw==","shasum":"03fc09b79e98c88d1a4fb47c953ed9082633eb34","tarball":"https://registry.npmjs.org/@azangru/with-express-graceful-shutdown/-/with-express-graceful-shutdown-0.0.2.tgz","fileCount":3,"unpackedSize":3904,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcQ4vlCRA9TVsSAnZWagAA7gEP/0jJdGxhjks5UYIwWVYY\n2WRVt2Hk+I8ON2jKbJy77Ohb6OPYr8CxC3C/ZCiTTUxDryIKqtZXyHn36EKc\nj1M5snYn7YHJRkQV2FVSUdfws+iBKvFRvbDifn3N5HouVm278ggr3asjsOr+\nSU9MAF+XbgwnJzloa0Xm3gDM7p+vUl+0kob7PRD6cZjTZfWIlai3Ojnk2aFv\nYV4hQWFrgJkzIqQgyfbTM9s1NwpKPKAk8a2gZ5yVW1fScJfbAxGG13S2vso0\nGGssOGiVWKNr7Pw7qUZmOsrBiPykpfZtPk/wI+iVSYFESwIoG68ieqdAbuKl\n7IaXVYhsIvyFbswnN3Ifp69ifEOotaRVTkyuWKyhpAvbfCBxR9y4c/oIXsm8\nsF2n88nj+5z8bA9cmA387w04aIRFB5sxkd0jTy/i5PeLcIA5IBxi2JgJM+Wi\ngB89LlriPAPw05q1cwirVKpzd6I88vKu8g83rNYdkNPYACdIL28kWkRc4bJS\n1DLY90TYtBtkjaGc3yWFl5Q9yQCQ5C9mt5aJHrBpVOaK8yJgV4S95Z3xfIKY\nHBoAgMw/XBJltLeP17C9suBl87Xxw/k2oQiLDl4UkeTbqSUD3xwBeS0Au0sM\nGh0h0HMxFe7/wjHpuFX0IF3qCDpr4uBJiAtRHUUl4GN5SkmfNff7ZZIdRGzk\nGAvZ\r\n=8GdD\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDTLj1+LxXd8lGJ3VpsRAxvzXEnXXkfd/X5LmwlUjzSTgIgbAeJSrB1i8NL6Qz7DD6rCHesGCxyYbh0M9wzWFSFSvY="}]},"maintainers":[{"name":"azangru","email":"andrey.azov@gmail.com"}],"_npmUser":{"name":"azangru","email":"andrey.azov@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/with-express-graceful-shutdown_0.0.2_1547930596744_0.1088235647729987"},"_hasShrinkwrap":false}},"time":{"created":"2019-01-19T17:23:17.865Z","0.0.1":"2019-01-19T17:23:18.519Z","modified":"2022-04-04T17:15:22.498Z","0.0.2":"2019-01-19T20:43:16.834Z"},"maintainers":[{"name":"azangru","email":"andrey.azov@gmail.com"}],"description":"Decorator for Express apps to enable graceful shutdown","homepage":"https://github.com/azangru/with-express-graceful-shutdown#readme","keywords":[],"repository":{"type":"git","url":"git+https://github.com/azangru/with-express-graceful-shutdown.git"},"bugs":{"url":"https://github.com/azangru/with-express-graceful-shutdown/issues"},"license":"ISC","readme":"# Graceful Shutdown\n\n## Summary\nThis is a decorator for an Express http server enabling its graceful shutdown.\n\nBased on ideas from:\n\n1) [express-graceful-shutdown middleware](https://github.com/serby/express-graceful-shutdown), which in turn used [this blog post](http://blog.argteam.com/coding/hardening-node-js-for-production-part-3-zero-downtime-deployments-with-nginx) for inspiration;\n\n2) [http-shutdown module](https://github.com/thedillonb/http-shutdown)\n\n## Installation\n\n`npm install @azangru/with-express-graceful-shutdown --save`\n\n## Usage\n\n```javascript\nconst withGracefulShutdown = require('@azangru/with-express-graceful-shutdown');\nconst app = require('./app'); // a regular Express app\nconst logger = require('./logger') // a custom logger\n\nconst expressPort = 3000;\nconst forceTimout = 30 * 1000; // timeout after which the app should be shut down forcefully\n\nconst options = {\n  logger,\n  forceTimout\n}\n\nconst server = app.listen(expressPort, () => {\n  // your server is running\n});\n\nwithGracefulShutdown(server, options);\n```\n\n## Options\n\n- `logger`: a logger that provides `info`, `warn`, and `error` functions for recording graceful shutdown. Default: `console`.\n\n- `forceTimeout`: number of milliseconds to wait for server.close() to complete before calling process.exit(1). Default: 60000.\n","readmeFilename":"README.md"}