{"_id":"serverswap","_rev":"73-3e8993245fe5b394922db8da78b72bef","name":"serverswap","description":"serverswap ==========","dist-tags":{"latest":"1.4.5"},"versions":{"1.0.0":{"name":"serverswap","version":"1.0.0","private":false,"bin":{"serverswap":"./lib/serverswap.js"},"engines":{"node":">=0.8.6"},"dependencies":{"async":"*"},"readme":"serverswap\n==========\n\nServerSwap is a small command-line utility, written in Node.js, that has one job: perform zero-downtime server restarts.\n\nGet it\n------\n`npm install -g serverswap`\n\nCommand-line Usage\n------------------\nStart your server like this:\n\nIf your server is server.js in the current directory: `serverswap node server.js` \n\nYou can also pass command-line arguments to your server: `serverswap node server.js a b c`\n\nYour server does not need to be running on Node.js, but I have only provided a client library for Node.js currently.\n\nServer Usage\n------------\nThe core intuition behind ServerSwap is that servers can communicate with ServerSwap to let it know when everything they need has been initialized, and\nall they need to do is bind to a port.\n\nWhen the ServerSwap instance receives the readyFor message, it will attempt to find an existing server, bring it down, and then send a message back to your new server that it can safely start up.\n\nOld servers are killed unceremoniously by default, but you can also set your server to respond to a `takeDown` message:\n\n```\n// server.js\n// Start with: serverswap server.js\nvar http = require('http')\n  , serverswap = require('../');\n\n// connect to databases\n// ...\n// load some more stuff\n// ...\n\nserverswap.readyFor(':8080', function () {\n  var server = http.createServer(function (req, res) {\n    res.writeHead(200, { 'Content-Type': 'text/plain' });\n    res.end(\"Hello World!\\n\");\n  }).listen(8080);\n\n  console.log('Listening on port 8080');\n\n  serverswap.onTakedown(':8080', function () {\n    // Stop taking new connections on port 80\n    console.log('Took down port 8080');\n    server.close();\n    // Give existing requests 5 seconds to finish processing\n    setTimeout(function () {\n      process.exit(0);\n    }, 5*1000);\n  });\n})\n```\n\nYou can send as many `readyFor` and `onTakedown` messages as you want for a staggered server deploy. `serverswap` will keep running until the older server process exits.\n\nMotivation\n----------\nWhile working on SpanDeX.io I would often need to deploy code to our production servers, which resulted in (at worst) 30 seconds to (at best) 6 seconds of downtime in which users would be disconnected from documents and the server would appear dead to the outside world.\n\nI'm sure I wasn't the first person to think of this, but I had a simple intuition: just don't take down the old server process until the new server process is ready to listen on an HTTP port. Between deploys and server restarts, this result in close to 0 milliseconds of downtime.\n\nCredit\n------\nDeveloped and maintained by Joshua Gross <josh@spandex.io> for SpanDeX.io.\n\nLicense\n-------\nMIT.\n","_id":"serverswap@1.0.0","description":"serverswap ==========","dist":{"shasum":"173af2aa3f316e6976d7cd856366815fd246c49a","tarball":"https://registry.npmjs.org/serverswap/-/serverswap-1.0.0.tgz","integrity":"sha512-ruceMeRE5UeNKGOGhwgXhe44Jllu3E5X3iQ3bNL/j8ffcsNu/W6J9qtW6ciazMSn2xsNUPKNAXJieas1W61eJQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFV/i0HDUXuixl/4iyzLM8K99TXYXxtYtdmHFfn5XLhZAiA1FXHlo6lz58qOwR0xFdn4H+VrXTEDpZwoR7Q0LSy5vg=="}]},"maintainers":[{"name":"joshuagross","email":"josh@spandex.io"}]},"1.0.1":{"name":"serverswap","version":"1.0.1","private":false,"bin":{"serverswap":"./lib/serverswap.js"},"engines":{"node":">=0.8.6"},"dependencies":{"async":"*"},"readme":"serverswap\n==========\n\nServerSwap is a small command-line utility, written in Node.js, that has one job: perform zero-downtime server restarts.\n\nGet it\n------\n`npm install -g serverswap`\n\nCommand-line Usage\n------------------\nStart your server like this:\n\nIf your server is server.js in the current directory: `serverswap node server.js` \n\nYou can also pass command-line arguments to your server: `serverswap node server.js a b c`\n\nYour server does not need to be running on Node.js, but I have only provided a client library for Node.js currently.\n\nServer Usage\n------------\nThe core intuition behind ServerSwap is that servers can communicate with ServerSwap to let it know when everything they need has been initialized, and\nall they need to do is bind to a port.\n\nWhen the ServerSwap instance receives the readyFor message, it will attempt to find an existing server, bring it down, and then send a message back to your new server that it can safely start up.\n\nOld servers are killed unceremoniously by default, but you can also set your server to respond to a `takeDown` message:\n\n```\n// server.js\n// Start with: serverswap server.js\nvar http = require('http')\n  , serverswap = require('../');\n\n// connect to databases\n// ...\n// load some more stuff\n// ...\n\nserverswap.readyFor(':8080', function () {\n  var server = http.createServer(function (req, res) {\n    res.writeHead(200, { 'Content-Type': 'text/plain' });\n    res.end(\"Hello World!\\n\");\n  }).listen(8080);\n\n  console.log('Listening on port 8080');\n\n  serverswap.onTakedown(':8080', function () {\n    // Stop taking new connections on port 80\n    console.log('Took down port 8080');\n    server.close();\n    // Give existing requests 5 seconds to finish processing\n    setTimeout(function () {\n      process.exit(0);\n    }, 5*1000);\n  });\n})\n```\n\nYou can send as many `readyFor` and `onTakedown` messages as you want for a staggered server deploy. `serverswap` will keep running until the older server process exits.\n\nMotivation\n----------\nWhile working on SpanDeX.io I would often need to deploy code to our production servers, which resulted in (at worst) 30 seconds to (at best) 6 seconds of downtime in which users would be disconnected from documents and the server would appear dead to the outside world.\n\nI'm sure I wasn't the first person to think of this, but I had a simple intuition: just don't take down the old server process until the new server process is ready to listen on an HTTP port. Between deploys and server restarts, this result in close to 0 milliseconds of downtime.\n\nCredit\n------\nDeveloped and maintained by Joshua Gross <josh@spandex.io> for SpanDeX.io.\n\nLicense\n-------\nMIT.\n","_id":"serverswap@1.0.1","description":"serverswap ==========","dist":{"shasum":"6bcb20b699d2937fef5656e751c28e3f324a5e48","tarball":"https://registry.npmjs.org/serverswap/-/serverswap-1.0.1.tgz","integrity":"sha512-woUxmJKrzOkLsBU/Ge0FUqHZbeqKtbfPc1WAlsCkf/2zuy2vl1Iru77jyc8NNCZKcr+5u5LGZoPO9a31sT9nRw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFsgdVdbev21QqenpsDb+ArZmeOfec30PSR8BUzO8mpoAiAuNlp+09CfZ8P0u7F/gj7gEuN/lzQZGgdmUJFx4Yy5wQ=="}]},"maintainers":[{"name":"joshuagross","email":"josh@spandex.io"}]},"1.1.0":{"name":"serverswap","version":"1.1.0","private":false,"bin":{"serverswap":"./lib/serverswap.js","serverswap-deploy":"./lib/serverswap.js"},"engines":{"node":">=0.8.6"},"dependencies":{"async":"*"},"readme":"serverswap\n==========\n\nServerSwap is a small command-line utility, written in Node.js, that has one job: perform zero-downtime server restarts.\n\nGet it\n------\n`npm install -g serverswap`\n\nCommand-line Usage\n------------------\nStart your server like this:\n\nIf your server is server.js in the current directory: `serverswap node server.js` \n\nYou can also pass command-line arguments to your server: `serverswap node server.js a b c`\n\nYour server does not need to be running on Node.js, but I have only provided a client library for Node.js currently.\n\nServer Usage\n------------\nThe core intuition behind ServerSwap is that servers can communicate with ServerSwap to let it know when everything they need has been initialized, and\nall they need to do is bind to a port.\n\nWhen the ServerSwap instance receives the readyFor message, it will attempt to find an existing server, bring it down, and then send a message back to your new server that it can safely start up.\n\nOld servers are killed unceremoniously by default, but you can also set your server to respond to a `takeDown` message:\n\n```\n// server.js\n// Start with: serverswap server.js\nvar http = require('http')\n  , serverswap = require('../');\n\n// connect to databases\n// ...\n// load some more stuff\n// ...\n\nserverswap.readyFor(':8080', function () {\n  var server = http.createServer(function (req, res) {\n    res.writeHead(200, { 'Content-Type': 'text/plain' });\n    res.end(\"Hello World!\\n\");\n  }).listen(8080);\n\n  console.log('Listening on port 8080');\n\n  serverswap.onTakedown(':8080', function () {\n    // Stop taking new connections on port 80\n    console.log('Took down port 8080');\n    server.close();\n    // Give existing requests 5 seconds to finish processing\n    setTimeout(function () {\n      process.exit(0);\n    }, 5*1000);\n  });\n})\n```\n\nYou can send as many `readyFor` and `onTakedown` messages as you want for a staggered server deploy. `serverswap` will keep running until the older server process exits.\n\nMotivation\n----------\nWhile working on SpanDeX.io I would often need to deploy code to our production servers, which resulted in (at worst) 30 seconds to (at best) 6 seconds of downtime in which users would be disconnected from documents and the server would appear dead to the outside world.\n\nI'm sure I wasn't the first person to think of this, but I had a simple intuition: just don't take down the old server process until the new server process is ready to listen on an HTTP port. Between deploys and server restarts, this result in close to 0 milliseconds of downtime.\n\nCredit\n------\nDeveloped and maintained by Joshua Gross <josh@spandex.io> for SpanDeX.io.\n\nLicense\n-------\nMIT.\n","_id":"serverswap@1.1.0","description":"serverswap ==========","dist":{"shasum":"4393f0ff0a1ed3c36af5114adee9cd5eaf7c3e83","tarball":"https://registry.npmjs.org/serverswap/-/serverswap-1.1.0.tgz","integrity":"sha512-xPeLXVuePf2mi1cPk8kATkssecOzsTik+y1V1ff2KJ4n4ncdhpFnAdKi0z60omTQSIG3v3Rp+Jqi1YWejRLrpA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD7WwL4AcPM7LZzAAnYYadttfNYMUUWUxdPtci5VOQY0wIgRnCmUgRmjicA7q+luOuHZEW6djdmtm9eDPNi8KoYzJ0="}]},"maintainers":[{"name":"joshuagross","email":"josh@spandex.io"}]},"1.1.1":{"name":"serverswap","version":"1.1.1","private":false,"bin":{"serverswap":"./lib/serverswap.js","serverswap-deploy":"./lib/serverswap.js"},"engines":{"node":">=0.8.6"},"dependencies":{"async":"*"},"readme":"serverswap\n==========\n\nServerSwap is a small command-line utility, written in Node.js, that has one job: perform zero-downtime server restarts.\n\nGet it\n------\n`npm install -g serverswap`\n\nCommand-line Usage\n------------------\nStart your server like this:\n\nIf your server is server.js in the current directory: `serverswap node server.js` \n\nYou can also pass command-line arguments to your server: `serverswap node server.js a b c`\n\nYour server does not need to be running on Node.js, but I have only provided a client library for Node.js currently.\n\nServer Usage\n------------\nThe core intuition behind ServerSwap is that servers can communicate with ServerSwap to let it know when everything they need has been initialized, and\nall they need to do is bind to a port.\n\nWhen the ServerSwap instance receives the readyFor message, it will attempt to find an existing server, bring it down, and then send a message back to your new server that it can safely start up.\n\nOld servers are killed unceremoniously by default, but you can also set your server to respond to a `takeDown` message:\n\n```\n// server.js\n// Start with: serverswap server.js\nvar http = require('http')\n  , serverswap = require('../');\n\n// connect to databases\n// ...\n// load some more stuff\n// ...\n\nserverswap.readyFor(':8080', function () {\n  var server = http.createServer(function (req, res) {\n    res.writeHead(200, { 'Content-Type': 'text/plain' });\n    res.end(\"Hello World!\\n\");\n  }).listen(8080);\n\n  console.log('Listening on port 8080');\n\n  serverswap.onTakedown(':8080', function () {\n    // Stop taking new connections on port 80\n    console.log('Took down port 8080');\n    server.close();\n    // Give existing requests 5 seconds to finish processing\n    setTimeout(function () {\n      process.exit(0);\n    }, 5*1000);\n  });\n})\n```\n\nYou can send as many `readyFor` and `onTakedown` messages as you want for a staggered server deploy. `serverswap` will keep running until the older server process exits.\n\nMotivation\n----------\nWhile working on SpanDeX.io I would often need to deploy code to our production servers, which resulted in (at worst) 30 seconds to (at best) 6 seconds of downtime in which users would be disconnected from documents and the server would appear dead to the outside world.\n\nI'm sure I wasn't the first person to think of this, but I had a simple intuition: just don't take down the old server process until the new server process is ready to listen on an HTTP port. Between deploys and server restarts, this result in close to 0 milliseconds of downtime.\n\nCredit\n------\nDeveloped and maintained by Joshua Gross <josh@spandex.io> for SpanDeX.io.\n\nLicense\n-------\nMIT.\n","_id":"serverswap@1.1.1","description":"serverswap ==========","dist":{"shasum":"e8f4a7953866625e1310b5809abb177f28251a7e","tarball":"https://registry.npmjs.org/serverswap/-/serverswap-1.1.1.tgz","integrity":"sha512-Ou/cHsi2qDbziFsd/ACfU/95KwfzXO8OmfOgGKG+VdfcCE0kSIWoNLniVXtqviAfzg+44sUPCU9vxEg009M96w==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDN4lfTV8IEKZbUdav9cmYOAe9B1fg29VF+qLAvBC5M0gIgPPtJrii6H+5YR2j7R2zvAPrePouTEGCpPakrNiebahg="}]},"maintainers":[{"name":"joshuagross","email":"josh@spandex.io"}]},"1.1.2":{"name":"serverswap","version":"1.1.2","private":false,"bin":{"serverswap":"./lib/serverswap.js","serverswap-deploy":"./lib/serverswap.js"},"engines":{"node":">=0.8.6"},"dependencies":{"async":"*"},"readme":"serverswap\n==========\n\nServerSwap is a small command-line utility, written in Node.js, that has one job: perform zero-downtime server restarts.\n\nGet it\n------\n`npm install -g serverswap`\n\nCommand-line Usage\n------------------\nStart your server like this:\n\nIf your server is server.js in the current directory: `serverswap node server.js` \n\nYou can also pass command-line arguments to your server: `serverswap node server.js a b c`\n\nYour server does not need to be running on Node.js, but I have only provided a client library for Node.js currently.\n\nServer Usage\n------------\nThe core intuition behind ServerSwap is that servers can communicate with ServerSwap to let it know when everything they need has been initialized, and\nall they need to do is bind to a port.\n\nWhen the ServerSwap instance receives the readyFor message, it will attempt to find an existing server, bring it down, and then send a message back to your new server that it can safely start up.\n\nOld servers are killed unceremoniously by default, but you can also set your server to respond to a `takeDown` message:\n\n```\n// server.js\n// Start with: serverswap server.js\nvar http = require('http')\n  , serverswap = require('../');\n\n// connect to databases\n// ...\n// load some more stuff\n// ...\n\nserverswap.readyFor(':8080', function () {\n  var server = http.createServer(function (req, res) {\n    res.writeHead(200, { 'Content-Type': 'text/plain' });\n    res.end(\"Hello World!\\n\");\n  }).listen(8080);\n\n  console.log('Listening on port 8080');\n\n  serverswap.onTakedown(':8080', function () {\n    // Stop taking new connections on port 80\n    console.log('Took down port 8080');\n    server.close();\n    // Give existing requests 5 seconds to finish processing\n    setTimeout(function () {\n      process.exit(0);\n    }, 5*1000);\n  });\n})\n```\n\nYou can send as many `readyFor` and `onTakedown` messages as you want for a staggered server deploy. `serverswap` will keep running until the older server process exits.\n\nMotivation\n----------\nWhile working on SpanDeX.io I would often need to deploy code to our production servers, which resulted in (at worst) 30 seconds to (at best) 6 seconds of downtime in which users would be disconnected from documents and the server would appear dead to the outside world.\n\nI'm sure I wasn't the first person to think of this, but I had a simple intuition: just don't take down the old server process until the new server process is ready to listen on an HTTP port. Between deploys and server restarts, this result in close to 0 milliseconds of downtime.\n\nCredit\n------\nDeveloped and maintained by Joshua Gross <josh@spandex.io> for SpanDeX.io.\n\nLicense\n-------\nMIT.\n","_id":"serverswap@1.1.2","description":"serverswap ==========","dist":{"shasum":"ff3118d9b9379049457f14cdcc727de4ad5247a9","tarball":"https://registry.npmjs.org/serverswap/-/serverswap-1.1.2.tgz","integrity":"sha512-cRGJme9A+fGOqCdgE2UGm4Cb73JOTpc/Z3X9vrXfaimWX6NpGsEN3aFTUHkuNPZ13e+BORPglU2hBZGepmDZVw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC4MSyW1UE0owAx6BLdjo6r29gyCE2WIl3MiU68NdVvqQIgfPOFwqFhcQ/iheoQRLOYMyEB+yMNhWE5szCTBiDcNwk="}]},"maintainers":[{"name":"joshuagross","email":"josh@spandex.io"}]},"1.1.3":{"name":"serverswap","version":"1.1.3","private":false,"bin":{"serverswap":"./lib/serverswap.js","serverswap-deploy":"./lib/serverswap.js"},"engines":{"node":">=0.8.6"},"dependencies":{"async":"*"},"readme":"serverswap\n==========\n\nServerSwap is a small command-line utility, written in Node.js, that has one job: perform zero-downtime server restarts.\n\nGet it\n------\n`npm install -g serverswap`\n\nCommand-line Usage\n------------------\nStart your server like this:\n\nIf your server is server.js in the current directory: `serverswap node server.js` \n\nYou can also pass command-line arguments to your server: `serverswap node server.js a b c`\n\nYour server does not need to be running on Node.js, but I have only provided a client library for Node.js currently.\n\nServer Usage\n------------\nThe core intuition behind ServerSwap is that servers can communicate with ServerSwap to let it know when everything they need has been initialized, and\nall they need to do is bind to a port.\n\nWhen the ServerSwap instance receives the readyFor message, it will attempt to find an existing server, bring it down, and then send a message back to your new server that it can safely start up.\n\nOld servers are killed unceremoniously by default, but you can also set your server to respond to a `takeDown` message:\n\n```\n// server.js\n// Start with: serverswap server.js\nvar http = require('http')\n  , serverswap = require('../');\n\n// connect to databases\n// ...\n// load some more stuff\n// ...\n\nserverswap.readyFor(':8080', function () {\n  var server = http.createServer(function (req, res) {\n    res.writeHead(200, { 'Content-Type': 'text/plain' });\n    res.end(\"Hello World!\\n\");\n  }).listen(8080);\n\n  console.log('Listening on port 8080');\n\n  serverswap.onTakedown(':8080', function () {\n    // Stop taking new connections on port 80\n    console.log('Took down port 8080');\n    server.close();\n    // Give existing requests 5 seconds to finish processing\n    setTimeout(function () {\n      process.exit(0);\n    }, 5*1000);\n  });\n})\n```\n\nYou can send as many `readyFor` and `onTakedown` messages as you want for a staggered server deploy. `serverswap` will keep running until the older server process exits.\n\nMotivation\n----------\nWhile working on SpanDeX.io I would often need to deploy code to our production servers, which resulted in (at worst) 30 seconds to (at best) 6 seconds of downtime in which users would be disconnected from documents and the server would appear dead to the outside world.\n\nI'm sure I wasn't the first person to think of this, but I had a simple intuition: just don't take down the old server process until the new server process is ready to listen on an HTTP port. Between deploys and server restarts, this result in close to 0 milliseconds of downtime.\n\nCredit\n------\nDeveloped and maintained by Joshua Gross <josh@spandex.io> for SpanDeX.io.\n\nLicense\n-------\nMIT.\n","_id":"serverswap@1.1.3","description":"serverswap ==========","dist":{"shasum":"e6acf44aa231735d537874d2cd4a3d381a3cd47d","tarball":"https://registry.npmjs.org/serverswap/-/serverswap-1.1.3.tgz","integrity":"sha512-XUiSZ+QLLoJ/MLedTUrAhIwR83aVqDmahFtuX9Mfh7amAV7Me0ifBMXdl5fG//ajVl+mD7MfWQh1H14iExUWlw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDYJzbiB4uK6Au9+wu7Rac+AkNnqALnvWFWaODKjFPQMAIhAIBc6s6w+V0VevkUbSASbKDQbmNRDSTRuFViBCAf1ppj"}]},"maintainers":[{"name":"joshuagross","email":"josh@spandex.io"}]},"1.1.4":{"name":"serverswap","version":"1.1.4","private":false,"bin":{"serverswap":"./lib/serverswap.js","serverswap-deploy":"./lib/serverswap.js"},"engines":{"node":">=0.8.6"},"dependencies":{"async":"*"},"readme":"serverswap\n==========\n\nServerSwap is a small command-line utility, written in Node.js, that has one job: perform zero-downtime server restarts.\n\nGet it\n------\n`npm install -g serverswap`\n\nCommand-line Usage\n------------------\nStart your server like this:\n\nIf your server is server.js in the current directory: `serverswap node server.js` \n\nYou can also pass command-line arguments to your server: `serverswap node server.js a b c`\n\nYour server does not need to be running on Node.js, but I have only provided a client library for Node.js currently.\n\nServer Usage\n------------\nThe core intuition behind ServerSwap is that servers can communicate with ServerSwap to let it know when everything they need has been initialized, and\nall they need to do is bind to a port.\n\nWhen the ServerSwap instance receives the readyFor message, it will attempt to find an existing server, bring it down, and then send a message back to your new server that it can safely start up.\n\nOld servers are killed unceremoniously by default, but you can also set your server to respond to a `takeDown` message:\n\n```\n// server.js\n// Start with: serverswap server.js\nvar http = require('http')\n  , serverswap = require('../');\n\n// connect to databases\n// ...\n// load some more stuff\n// ...\n\nserverswap.readyFor(':8080', function () {\n  var server = http.createServer(function (req, res) {\n    res.writeHead(200, { 'Content-Type': 'text/plain' });\n    res.end(\"Hello World!\\n\");\n  }).listen(8080);\n\n  console.log('Listening on port 8080');\n\n  serverswap.onTakedown(':8080', function () {\n    // Stop taking new connections on port 80\n    console.log('Took down port 8080');\n    server.close();\n    // Give existing requests 5 seconds to finish processing\n    setTimeout(function () {\n      process.exit(0);\n    }, 5*1000);\n  });\n})\n```\n\nYou can send as many `readyFor` and `onTakedown` messages as you want for a staggered server deploy. `serverswap` will keep running until the older server process exits.\n\nMotivation\n----------\nWhile working on SpanDeX.io I would often need to deploy code to our production servers, which resulted in (at worst) 30 seconds to (at best) 6 seconds of downtime in which users would be disconnected from documents and the server would appear dead to the outside world.\n\nI'm sure I wasn't the first person to think of this, but I had a simple intuition: just don't take down the old server process until the new server process is ready to listen on an HTTP port. Between deploys and server restarts, this result in close to 0 milliseconds of downtime.\n\nCredit\n------\nDeveloped and maintained by Joshua Gross <josh@spandex.io> for SpanDeX.io.\n\nLicense\n-------\nMIT.\n","_id":"serverswap@1.1.4","description":"serverswap ==========","dist":{"shasum":"f511d8d4354f63ff228218c4f218efac6b3ba2a7","tarball":"https://registry.npmjs.org/serverswap/-/serverswap-1.1.4.tgz","integrity":"sha512-SSws/VDPY/XSTJJTCBh6qxS2ZjsWa1/ilmSKJUJuvMkkO5VGUUhK5PCrMfiVOzJmIkWv8otMVgGxHya26UJHbQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAQ5+s1B2C4yzSXb2BPn9ShGxF0HbOWjk+kkgmDWPbdBAiBHjSsN1Qpdu6mQlZT5itbKRBsJOGUf7ZB6QNS85W6Oag=="}]},"maintainers":[{"name":"joshuagross","email":"josh@spandex.io"}]},"1.1.5":{"name":"serverswap","version":"1.1.5","private":false,"bin":{"serverswap":"./lib/serverswap.js","serverswap-deploy":"./lib/serverswap.js"},"engines":{"node":">=0.8.6"},"dependencies":{"async":"*"},"readme":"serverswap\n==========\n\nServerSwap is a small command-line utility, written in Node.js, that has one job: perform zero-downtime server restarts.\n\nGet it\n------\n`npm install -g serverswap`\n\nCommand-line Usage\n------------------\nStart your server like this:\n\nIf your server is server.js in the current directory: `serverswap node server.js` \n\nYou can also pass command-line arguments to your server: `serverswap node server.js a b c`\n\nYour server does not need to be running on Node.js, but I have only provided a client library for Node.js currently.\n\nServer Usage\n------------\nThe core intuition behind ServerSwap is that servers can communicate with ServerSwap to let it know when everything they need has been initialized, and\nall they need to do is bind to a port.\n\nWhen the ServerSwap instance receives the readyFor message, it will attempt to find an existing server, bring it down, and then send a message back to your new server that it can safely start up.\n\nOld servers are killed unceremoniously by default, but you can also set your server to respond to a `takeDown` message:\n\n```\n// server.js\n// Start with: serverswap server.js\nvar http = require('http')\n  , serverswap = require('../');\n\n// connect to databases\n// ...\n// load some more stuff\n// ...\n\nserverswap.readyFor(':8080', function () {\n  var server = http.createServer(function (req, res) {\n    res.writeHead(200, { 'Content-Type': 'text/plain' });\n    res.end(\"Hello World!\\n\");\n  }).listen(8080);\n\n  console.log('Listening on port 8080');\n\n  serverswap.onTakedown(':8080', function () {\n    // Stop taking new connections on port 80\n    console.log('Took down port 8080');\n    server.close();\n    // Give existing requests 5 seconds to finish processing\n    setTimeout(function () {\n      process.exit(0);\n    }, 5*1000);\n  });\n})\n```\n\nYou can send as many `readyFor` and `onTakedown` messages as you want for a staggered server deploy. `serverswap` will keep running until the older server process exits.\n\nMotivation\n----------\nWhile working on SpanDeX.io I would often need to deploy code to our production servers, which resulted in (at worst) 30 seconds to (at best) 6 seconds of downtime in which users would be disconnected from documents and the server would appear dead to the outside world.\n\nI'm sure I wasn't the first person to think of this, but I had a simple intuition: just don't take down the old server process until the new server process is ready to listen on an HTTP port. Between deploys and server restarts, this result in close to 0 milliseconds of downtime.\n\nCredit\n------\nDeveloped and maintained by Joshua Gross <josh@spandex.io> for SpanDeX.io.\n\nLicense\n-------\nMIT.\n","_id":"serverswap@1.1.5","description":"serverswap ==========","dist":{"shasum":"2886ff8908069ecb664278a72c329e1d362d302b","tarball":"https://registry.npmjs.org/serverswap/-/serverswap-1.1.5.tgz","integrity":"sha512-QPBlJjM67fZFeZquutWBV3UL0mKCfLDYkbKoNvtPhYjS1fUbSRcaRorlDD77SENSsT2ilRv3UmXQcOu76Ho0yg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCuKcJyBUrTqJAPTMmiWXdFwXz8dsUX2ZyJGZRDaDT5LQIgETZSkPVljIQHXVFNUyVcb/e8X225KiNu17E8vRlDJtU="}]},"maintainers":[{"name":"joshuagross","email":"josh@spandex.io"}]},"1.1.6":{"name":"serverswap","version":"1.1.6","private":false,"bin":{"serverswap":"./lib/serverswap.js","serverswap-deploy":"./lib/serverswap.js"},"engines":{"node":">=0.8.6"},"dependencies":{"async":"*"},"readme":"serverswap\n==========\n\nServerSwap is a small command-line utility, written in Node.js, that has one job: perform zero-downtime server restarts.\n\nGet it\n------\n`npm install -g serverswap`\n\nCommand-line Usage\n------------------\nStart your server like this:\n\nIf your server is server.js in the current directory: `serverswap node server.js` \n\nYou can also pass command-line arguments to your server: `serverswap node server.js a b c`\n\nYour server does not need to be running on Node.js, but I have only provided a client library for Node.js currently.\n\nServer Usage\n------------\nThe core intuition behind ServerSwap is that servers can communicate with ServerSwap to let it know when everything they need has been initialized, and\nall they need to do is bind to a port.\n\nWhen the ServerSwap instance receives the readyFor message, it will attempt to find an existing server, bring it down, and then send a message back to your new server that it can safely start up.\n\nOld servers are killed unceremoniously by default, but you can also set your server to respond to a `takeDown` message:\n\n```\n// server.js\n// Start with: serverswap server.js\nvar http = require('http')\n  , serverswap = require('../');\n\n// connect to databases\n// ...\n// load some more stuff\n// ...\n\nserverswap.readyFor(':8080', function () {\n  var server = http.createServer(function (req, res) {\n    res.writeHead(200, { 'Content-Type': 'text/plain' });\n    res.end(\"Hello World!\\n\");\n  }).listen(8080);\n\n  console.log('Listening on port 8080');\n\n  serverswap.onTakedown(':8080', function () {\n    // Stop taking new connections on port 80\n    console.log('Took down port 8080');\n    server.close();\n    // Give existing requests 5 seconds to finish processing\n    setTimeout(function () {\n      process.exit(0);\n    }, 5*1000);\n  });\n})\n```\n\nYou can send as many `readyFor` and `onTakedown` messages as you want for a staggered server deploy. `serverswap` will keep running until the older server process exits.\n\nMotivation\n----------\nWhile working on SpanDeX.io I would often need to deploy code to our production servers, which resulted in (at worst) 30 seconds to (at best) 6 seconds of downtime in which users would be disconnected from documents and the server would appear dead to the outside world.\n\nI'm sure I wasn't the first person to think of this, but I had a simple intuition: just don't take down the old server process until the new server process is ready to listen on an HTTP port. Between deploys and server restarts, this result in close to 0 milliseconds of downtime.\n\nCredit\n------\nDeveloped and maintained by Joshua Gross <josh@spandex.io> for SpanDeX.io.\n\nLicense\n-------\nMIT.\n","_id":"serverswap@1.1.6","description":"serverswap ==========","dist":{"shasum":"17a9e3104e2763390bfd676f8536b265c5a1e351","tarball":"https://registry.npmjs.org/serverswap/-/serverswap-1.1.6.tgz","integrity":"sha512-YpWkd4Ifp0XK+lokuU4dCyXpFxtJdocTCsTTrY5wHDWrcDp3hYQQL1dogXor/gZVzJnK93GDd2GRm+DhYOcWOQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFDvTyom9Aofq8HBZ0h6OKm8TijRT1ZV+vXHmEq3ZehAAiAFEw2ZRiFQ6TPVwchZMJFavB8D1Zr7seGD+JBl52l3RA=="}]},"maintainers":[{"name":"joshuagross","email":"josh@spandex.io"}]},"1.1.7":{"name":"serverswap","version":"1.1.7","private":false,"bin":{"serverswap":"./lib/serverswap.js","serverswap-deploy":"./lib/serverswap.js"},"engines":{"node":">=0.8.6"},"dependencies":{"async":"*"},"readme":"serverswap\n==========\n\nServerSwap is a small command-line utility, written in Node.js, that has one job: perform zero-downtime server restarts.\n\nGet it\n------\n`npm install -g serverswap`\n\nCommand-line Usage\n------------------\nStart your server like this:\n\nIf your server is server.js in the current directory: `serverswap node server.js` \n\nYou can also pass command-line arguments to your server: `serverswap node server.js a b c`\n\nYour server does not need to be running on Node.js, but I have only provided a client library for Node.js currently.\n\nServer Usage\n------------\nThe core intuition behind ServerSwap is that servers can communicate with ServerSwap to let it know when everything they need has been initialized, and\nall they need to do is bind to a port.\n\nWhen the ServerSwap instance receives the readyFor message, it will attempt to find an existing server, bring it down, and then send a message back to your new server that it can safely start up.\n\nOld servers are killed unceremoniously by default, but you can also set your server to respond to a `takeDown` message:\n\n```\n// server.js\n// Start with: serverswap server.js\nvar http = require('http')\n  , serverswap = require('../');\n\n// connect to databases\n// ...\n// load some more stuff\n// ...\n\nserverswap.readyFor(':8080', function () {\n  var server = http.createServer(function (req, res) {\n    res.writeHead(200, { 'Content-Type': 'text/plain' });\n    res.end(\"Hello World!\\n\");\n  }).listen(8080);\n\n  console.log('Listening on port 8080');\n\n  serverswap.onTakedown(':8080', function () {\n    // Stop taking new connections on port 80\n    console.log('Took down port 8080');\n    server.close();\n    // Give existing requests 5 seconds to finish processing\n    setTimeout(function () {\n      process.exit(0);\n    }, 5*1000);\n  });\n})\n```\n\nYou can send as many `readyFor` and `onTakedown` messages as you want for a staggered server deploy. `serverswap` will keep running until the older server process exits.\n\nMotivation\n----------\nWhile working on SpanDeX.io I would often need to deploy code to our production servers, which resulted in (at worst) 30 seconds to (at best) 6 seconds of downtime in which users would be disconnected from documents and the server would appear dead to the outside world.\n\nI'm sure I wasn't the first person to think of this, but I had a simple intuition: just don't take down the old server process until the new server process is ready to listen on an HTTP port. Between deploys and server restarts, this result in close to 0 milliseconds of downtime.\n\nCredit\n------\nDeveloped and maintained by Joshua Gross <josh@spandex.io> for SpanDeX.io.\n\nLicense\n-------\nMIT.\n","_id":"serverswap@1.1.7","description":"serverswap ==========","dist":{"shasum":"aeb3e8052b439ea635f0d2244de434b5564cacd0","tarball":"https://registry.npmjs.org/serverswap/-/serverswap-1.1.7.tgz","integrity":"sha512-aNP92o3RIEGnqJvCUIoNdVD+xFghM4yGdKcxQsp7Z9x/q9BUzy8wja8csEr74kzH0fN7eMqmGlgBZNRTQUT4NA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC+C4oZ+KLNifHiFWgcqejXZF3r8vbWy+Rdi4uUO88ztgIgP5Y6lNv7Drf9izWovTLay21BUwympdv/p4RU2zUafDo="}]},"maintainers":[{"name":"joshuagross","email":"josh@spandex.io"}]},"1.1.8":{"name":"serverswap","version":"1.1.8","private":false,"bin":{"serverswap":"./lib/serverswap.js","serverswap-deploy":"./lib/serverswap.js"},"engines":{"node":">=0.8.6"},"dependencies":{"async":"*"},"readme":"serverswap\n==========\n\nServerSwap is a small command-line utility, written in Node.js, that has one job: perform zero-downtime server restarts.\n\nGet it\n------\n`npm install -g serverswap`\n\nCommand-line Usage\n------------------\nStart your server like this:\n\nIf your server is server.js in the current directory: `serverswap node server.js` \n\nYou can also pass command-line arguments to your server: `serverswap node server.js a b c`\n\nYour server does not need to be running on Node.js, but I have only provided a client library for Node.js currently.\n\nServer Usage\n------------\nThe core intuition behind ServerSwap is that servers can communicate with ServerSwap to let it know when everything they need has been initialized, and\nall they need to do is bind to a port.\n\nWhen the ServerSwap instance receives the readyFor message, it will attempt to find an existing server, bring it down, and then send a message back to your new server that it can safely start up.\n\nOld servers are killed unceremoniously by default, but you can also set your server to respond to a `takeDown` message:\n\n```\n// server.js\n// Start with: serverswap server.js\nvar http = require('http')\n  , serverswap = require('../');\n\n// connect to databases\n// ...\n// load some more stuff\n// ...\n\nserverswap.readyFor(':8080', function () {\n  var server = http.createServer(function (req, res) {\n    res.writeHead(200, { 'Content-Type': 'text/plain' });\n    res.end(\"Hello World!\\n\");\n  }).listen(8080);\n\n  console.log('Listening on port 8080');\n\n  serverswap.onTakedown(':8080', function () {\n    // Stop taking new connections on port 80\n    console.log('Took down port 8080');\n    server.close();\n    // Give existing requests 5 seconds to finish processing\n    setTimeout(function () {\n      process.exit(0);\n    }, 5*1000);\n  });\n})\n```\n\nYou can send as many `readyFor` and `onTakedown` messages as you want for a staggered server deploy. `serverswap` will keep running until the older server process exits.\n\nMotivation\n----------\nWhile working on SpanDeX.io I would often need to deploy code to our production servers, which resulted in (at worst) 30 seconds to (at best) 6 seconds of downtime in which users would be disconnected from documents and the server would appear dead to the outside world.\n\nI'm sure I wasn't the first person to think of this, but I had a simple intuition: just don't take down the old server process until the new server process is ready to listen on an HTTP port. Between deploys and server restarts, this result in close to 0 milliseconds of downtime.\n\nCredit\n------\nDeveloped and maintained by Joshua Gross <josh@spandex.io> for SpanDeX.io.\n\nLicense\n-------\nMIT.\n","_id":"serverswap@1.1.8","description":"serverswap ==========","dist":{"shasum":"284304ccf48dfd5490eebdb9ab2cd6e4dc2e2c31","tarball":"https://registry.npmjs.org/serverswap/-/serverswap-1.1.8.tgz","integrity":"sha512-otmy9YJi/mmmRKF3CehyLqx/Leumdsqa3qbncgc65UKUWodOJud+RSqRgsXcRXKxnFXbM+WK99mibRpbMhr5Jw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGwgJJdnrU2oqg0u3EdHB5X/tK7/M76eGRd2t7Vip104AiEArZjtL+dR9nZ0bogXZozUFYnUOihuKtLg+/pRY1AIIj0="}]},"maintainers":[{"name":"joshuagross","email":"josh@spandex.io"}]},"1.1.9":{"name":"serverswap","version":"1.1.9","private":false,"bin":{"serverswap":"./lib/serverswap.js","serverswap-deploy":"./lib/serverswap.js"},"engines":{"node":">=0.8.6"},"dependencies":{"async":"*"},"readme":"serverswap\n==========\n\nServerSwap is a small command-line utility, written in Node.js, that has one job: perform zero-downtime server restarts.\n\nGet it\n------\n`npm install -g serverswap`\n\nCommand-line Usage\n------------------\nStart your server like this:\n\nIf your server is server.js in the current directory: `serverswap node server.js` \n\nYou can also pass command-line arguments to your server: `serverswap node server.js a b c`\n\nYour server does not need to be running on Node.js, but I have only provided a client library for Node.js currently.\n\nServer Usage\n------------\nThe core intuition behind ServerSwap is that servers can communicate with ServerSwap to let it know when everything they need has been initialized, and\nall they need to do is bind to a port.\n\nWhen the ServerSwap instance receives the readyFor message, it will attempt to find an existing server, bring it down, and then send a message back to your new server that it can safely start up.\n\nOld servers are killed unceremoniously by default, but you can also set your server to respond to a `takeDown` message:\n\n```\n// server.js\n// Start with: serverswap server.js\nvar http = require('http')\n  , serverswap = require('../');\n\n// connect to databases\n// ...\n// load some more stuff\n// ...\n\nserverswap.readyFor(':8080', function () {\n  var server = http.createServer(function (req, res) {\n    res.writeHead(200, { 'Content-Type': 'text/plain' });\n    res.end(\"Hello World!\\n\");\n  }).listen(8080);\n\n  console.log('Listening on port 8080');\n\n  serverswap.onTakedown(':8080', function () {\n    // Stop taking new connections on port 80\n    console.log('Took down port 8080');\n    server.close();\n    // Give existing requests 5 seconds to finish processing\n    setTimeout(function () {\n      process.exit(0);\n    }, 5*1000);\n  });\n})\n```\n\nYou can send as many `readyFor` and `onTakedown` messages as you want for a staggered server deploy. `serverswap` will keep running until the older server process exits.\n\nMotivation\n----------\nWhile working on SpanDeX.io I would often need to deploy code to our production servers, which resulted in (at worst) 30 seconds to (at best) 6 seconds of downtime in which users would be disconnected from documents and the server would appear dead to the outside world.\n\nI'm sure I wasn't the first person to think of this, but I had a simple intuition: just don't take down the old server process until the new server process is ready to listen on an HTTP port. Between deploys and server restarts, this result in close to 0 milliseconds of downtime.\n\nCredit\n------\nDeveloped and maintained by Joshua Gross <josh@spandex.io> for SpanDeX.io.\n\nLicense\n-------\nMIT.\n","_id":"serverswap@1.1.9","description":"serverswap ==========","dist":{"shasum":"16b7c9f2d8388fddbb0ac11feadf244933b71694","tarball":"https://registry.npmjs.org/serverswap/-/serverswap-1.1.9.tgz","integrity":"sha512-pl7GTSr8BIug9LOogeRcbCaXkUCslAoBdXXIk5aisKm5RJKK/IwCPceTV54cSvcc8Lbn/JmEQ8uJw4liGd3FNg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCRVpDgc2QqaDOXtBwGC18/sbDo733m6MdsbZ34mxSvjAIgNfnFqMzVu0xPyYSS1cO6yQaLytyw5/TriVgR0nzdAQw="}]},"maintainers":[{"name":"joshuagross","email":"josh@spandex.io"}]},"1.1.10":{"name":"serverswap","version":"1.1.10","private":false,"bin":{"serverswap":"./lib/serverswap.js","serverswap-deploy":"./lib/serverswap.js"},"engines":{"node":">=0.8.6"},"dependencies":{"async":"*"},"readme":"serverswap\n==========\n\nServerSwap is a small command-line utility, written in Node.js, that has one job: perform zero-downtime server restarts.\n\nGet it\n------\n`npm install -g serverswap`\n\nCommand-line Usage\n------------------\nStart your server like this:\n\nIf your server is server.js in the current directory: `serverswap node server.js` \n\nYou can also pass command-line arguments to your server: `serverswap node server.js a b c`\n\nYour server does not need to be running on Node.js, but I have only provided a client library for Node.js currently.\n\nServer Usage\n------------\nThe core intuition behind ServerSwap is that servers can communicate with ServerSwap to let it know when everything they need has been initialized, and\nall they need to do is bind to a port.\n\nWhen the ServerSwap instance receives the readyFor message, it will attempt to find an existing server, bring it down, and then send a message back to your new server that it can safely start up.\n\nOld servers are killed unceremoniously by default, but you can also set your server to respond to a `takeDown` message:\n\n```\n// server.js\n// Start with: serverswap server.js\nvar http = require('http')\n  , serverswap = require('../');\n\n// connect to databases\n// ...\n// load some more stuff\n// ...\n\nserverswap.readyFor(':8080', function () {\n  var server = http.createServer(function (req, res) {\n    res.writeHead(200, { 'Content-Type': 'text/plain' });\n    res.end(\"Hello World!\\n\");\n  }).listen(8080);\n\n  console.log('Listening on port 8080');\n\n  serverswap.onTakedown(':8080', function () {\n    // Stop taking new connections on port 80\n    console.log('Took down port 8080');\n    server.close();\n    // Give existing requests 5 seconds to finish processing\n    setTimeout(function () {\n      process.exit(0);\n    }, 5*1000);\n  });\n})\n```\n\nYou can send as many `readyFor` and `onTakedown` messages as you want for a staggered server deploy. `serverswap` will keep running until the older server process exits.\n\nMotivation\n----------\nWhile working on SpanDeX.io I would often need to deploy code to our production servers, which resulted in (at worst) 30 seconds to (at best) 6 seconds of downtime in which users would be disconnected from documents and the server would appear dead to the outside world.\n\nI'm sure I wasn't the first person to think of this, but I had a simple intuition: just don't take down the old server process until the new server process is ready to listen on an HTTP port. Between deploys and server restarts, this result in close to 0 milliseconds of downtime.\n\nCredit\n------\nDeveloped and maintained by Joshua Gross <josh@spandex.io> for SpanDeX.io.\n\nLicense\n-------\nMIT.\n","_id":"serverswap@1.1.10","description":"serverswap ==========","dist":{"shasum":"bb38340394710d55b4f3cdd1e7a63974865d5d64","tarball":"https://registry.npmjs.org/serverswap/-/serverswap-1.1.10.tgz","integrity":"sha512-y930Odm493oK9aq74CNRzth7VpxL8XMYcN/nal92y6AIaPrpFhR6uWTvaO9s5qglzFebdm6lPNdyFvYGTpkTrg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCP4ovoopgtOd80kvwlyf37FuHqJBZ6THdt6RCSIT9hngIgdrAe2+sZwyg/YWqNBmC1nKrvgjTM7nNnC/LY4KHKMAc="}]},"maintainers":[{"name":"joshuagross","email":"josh@spandex.io"}]},"1.1.11":{"name":"serverswap","version":"1.1.11","private":false,"bin":{"serverswap":"./lib/serverswap.js","serverswap-deploy":"./lib/serverswap.js"},"engines":{"node":">=0.8.6"},"dependencies":{"async":"*"},"readme":"serverswap\n==========\n\nServerSwap is a small command-line utility, written in Node.js, that has one job: perform zero-downtime server restarts.\n\nGet it\n------\n`npm install -g serverswap`\n\nCommand-line Usage\n------------------\nStart your server like this:\n\nIf your server is server.js in the current directory: `serverswap node server.js` \n\nYou can also pass command-line arguments to your server: `serverswap node server.js a b c`\n\nYour server does not need to be running on Node.js, but I have only provided a client library for Node.js currently.\n\nServer Usage\n------------\nThe core intuition behind ServerSwap is that servers can communicate with ServerSwap to let it know when everything they need has been initialized, and\nall they need to do is bind to a port.\n\nWhen the ServerSwap instance receives the readyFor message, it will attempt to find an existing server, bring it down, and then send a message back to your new server that it can safely start up.\n\nOld servers are killed unceremoniously by default, but you can also set your server to respond to a `takeDown` message:\n\n```\n// server.js\n// Start with: serverswap server.js\nvar http = require('http')\n  , serverswap = require('../');\n\n// connect to databases\n// ...\n// load some more stuff\n// ...\n\nserverswap.readyFor(':8080', function () {\n  var server = http.createServer(function (req, res) {\n    res.writeHead(200, { 'Content-Type': 'text/plain' });\n    res.end(\"Hello World!\\n\");\n  }).listen(8080);\n\n  console.log('Listening on port 8080');\n\n  serverswap.onTakedown(':8080', function () {\n    // Stop taking new connections on port 80\n    console.log('Took down port 8080');\n    server.close();\n    // Give existing requests 5 seconds to finish processing\n    setTimeout(function () {\n      process.exit(0);\n    }, 5*1000);\n  });\n})\n```\n\nYou can send as many `readyFor` and `onTakedown` messages as you want for a staggered server deploy. `serverswap` will keep running until the older server process exits.\n\nMotivation\n----------\nWhile working on SpanDeX.io I would often need to deploy code to our production servers, which resulted in (at worst) 30 seconds to (at best) 6 seconds of downtime in which users would be disconnected from documents and the server would appear dead to the outside world.\n\nI'm sure I wasn't the first person to think of this, but I had a simple intuition: just don't take down the old server process until the new server process is ready to listen on an HTTP port. Between deploys and server restarts, this result in close to 0 milliseconds of downtime.\n\nCredit\n------\nDeveloped and maintained by Joshua Gross <josh@spandex.io> for SpanDeX.io.\n\nLicense\n-------\nMIT.\n","_id":"serverswap@1.1.11","description":"serverswap ==========","dist":{"shasum":"4974f74342d7ab162096898d060dc24061b3eaab","tarball":"https://registry.npmjs.org/serverswap/-/serverswap-1.1.11.tgz","integrity":"sha512-Sr2ai9tNJlSgFD97DvwRLmMJBnVVoXP/4F48Tn+W9JXQtLu5akDgU3/BLZnWALA+UsbNesZyehHtRMyiOzkSuA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBCodqezp6e3F4sZZ0S5DN8DBINLRLuSK8h7MipOHZfZAiEAjvyui2xeyhqTA2QE73LBrilPAgY8p7yWdQIRXP7fBj8="}]},"maintainers":[{"name":"joshuagross","email":"josh@spandex.io"}]},"1.1.12":{"name":"serverswap","version":"1.1.12","private":false,"bin":{"serverswap":"./lib/serverswap.js","serverswap-deploy":"./lib/serverswap.js"},"engines":{"node":">=0.8.6"},"dependencies":{"async":"*"},"readme":"serverswap\n==========\n\nServerSwap is a small command-line utility, written in Node.js, that has one job: perform zero-downtime server restarts.\n\nGet it\n------\n`npm install -g serverswap`\n\nCommand-line Usage\n------------------\nStart your server like this:\n\nIf your server is server.js in the current directory: `serverswap node server.js` \n\nYou can also pass command-line arguments to your server: `serverswap node server.js a b c`\n\nYour server does not need to be running on Node.js, but I have only provided a client library for Node.js currently.\n\nServer Usage\n------------\nThe core intuition behind ServerSwap is that servers can communicate with ServerSwap to let it know when everything they need has been initialized, and\nall they need to do is bind to a port.\n\nWhen the ServerSwap instance receives the readyFor message, it will attempt to find an existing server, bring it down, and then send a message back to your new server that it can safely start up.\n\nOld servers are killed unceremoniously by default, but you can also set your server to respond to a `takeDown` message:\n\n```\n// server.js\n// Start with: serverswap server.js\nvar http = require('http')\n  , serverswap = require('../');\n\n// connect to databases\n// ...\n// load some more stuff\n// ...\n\nserverswap.readyFor(':8080', function () {\n  var server = http.createServer(function (req, res) {\n    res.writeHead(200, { 'Content-Type': 'text/plain' });\n    res.end(\"Hello World!\\n\");\n  }).listen(8080);\n\n  console.log('Listening on port 8080');\n\n  serverswap.onTakedown(':8080', function () {\n    // Stop taking new connections on port 80\n    console.log('Took down port 8080');\n    server.close();\n    // Give existing requests 5 seconds to finish processing\n    setTimeout(function () {\n      process.exit(0);\n    }, 5*1000);\n  });\n})\n```\n\nYou can send as many `readyFor` and `onTakedown` messages as you want for a staggered server deploy. `serverswap` will keep running until the older server process exits.\n\nMotivation\n----------\nWhile working on SpanDeX.io I would often need to deploy code to our production servers, which resulted in (at worst) 30 seconds to (at best) 6 seconds of downtime in which users would be disconnected from documents and the server would appear dead to the outside world.\n\nI'm sure I wasn't the first person to think of this, but I had a simple intuition: just don't take down the old server process until the new server process is ready to listen on an HTTP port. Between deploys and server restarts, this result in close to 0 milliseconds of downtime.\n\nCredit\n------\nDeveloped and maintained by Joshua Gross <josh@spandex.io> for SpanDeX.io.\n\nLicense\n-------\nMIT.\n","_id":"serverswap@1.1.12","description":"serverswap ==========","dist":{"shasum":"6e30f21d95d159f3615ee1624ca933c7e9474087","tarball":"https://registry.npmjs.org/serverswap/-/serverswap-1.1.12.tgz","integrity":"sha512-HBT30LZ+c3XoKPgIavS2R2YHdFrgrPjplaQUeCZtQSSuHxzzpauMzLjEospndHmJD3rxdkmIuNqn3ecc7GxX4g==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIA85nSFF6gk+JV/urenwmTS4zWDkm7qKcJR686+JaRy9AiEAgL6heyqPOvwmFf87/uSniNj00d8cd1Wof9fzwnUuZgU="}]},"maintainers":[{"name":"joshuagross","email":"josh@spandex.io"}]},"1.1.13":{"name":"serverswap","version":"1.1.13","private":false,"bin":{"serverswap":"./lib/serverswap.js","serverswap-deploy":"./lib/serverswap.js"},"engines":{"node":">=0.8.6"},"dependencies":{"async":"*"},"readme":"serverswap\n==========\n\nServerSwap is a small command-line utility, written in Node.js, that has one job: perform zero-downtime server restarts.\n\nGet it\n------\n`npm install -g serverswap`\n\nCommand-line Usage\n------------------\nStart your server like this:\n\nIf your server is server.js in the current directory: `serverswap node server.js` \n\nYou can also pass command-line arguments to your server: `serverswap node server.js a b c`\n\nYour server does not need to be running on Node.js, but I have only provided a client library for Node.js currently.\n\nServer Usage\n------------\nThe core intuition behind ServerSwap is that servers can communicate with ServerSwap to let it know when everything they need has been initialized, and\nall they need to do is bind to a port.\n\nWhen the ServerSwap instance receives the readyFor message, it will attempt to find an existing server, bring it down, and then send a message back to your new server that it can safely start up.\n\nOld servers are killed unceremoniously by default, but you can also set your server to respond to a `takeDown` message:\n\n```\n// server.js\n// Start with: serverswap server.js\nvar http = require('http')\n  , serverswap = require('../');\n\n// connect to databases\n// ...\n// load some more stuff\n// ...\n\nserverswap.readyFor(':8080', function () {\n  var server = http.createServer(function (req, res) {\n    res.writeHead(200, { 'Content-Type': 'text/plain' });\n    res.end(\"Hello World!\\n\");\n  }).listen(8080);\n\n  console.log('Listening on port 8080');\n\n  serverswap.onTakedown(':8080', function () {\n    // Stop taking new connections on port 80\n    console.log('Took down port 8080');\n    server.close();\n    // Give existing requests 5 seconds to finish processing\n    setTimeout(function () {\n      process.exit(0);\n    }, 5*1000);\n  });\n})\n```\n\nYou can send as many `readyFor` and `onTakedown` messages as you want for a staggered server deploy. `serverswap` will keep running until the older server process exits.\n\nMotivation\n----------\nWhile working on SpanDeX.io I would often need to deploy code to our production servers, which resulted in (at worst) 30 seconds to (at best) 6 seconds of downtime in which users would be disconnected from documents and the server would appear dead to the outside world.\n\nI'm sure I wasn't the first person to think of this, but I had a simple intuition: just don't take down the old server process until the new server process is ready to listen on an HTTP port. Between deploys and server restarts, this result in close to 0 milliseconds of downtime.\n\nCredit\n------\nDeveloped and maintained by Joshua Gross <josh@spandex.io> for SpanDeX.io.\n\nLicense\n-------\nMIT.\n","_id":"serverswap@1.1.13","description":"serverswap ==========","dist":{"shasum":"6712ea5d22043c7c7fd869aef69cffad300f66d4","tarball":"https://registry.npmjs.org/serverswap/-/serverswap-1.1.13.tgz","integrity":"sha512-u75zde6FOvZ6gt7iBPY8o/LOUICbECX8ytckIpIUZxRltbnjAgdKZ3ERTsUEa98OPFSqoO3eDvkQmyEsDfGvPA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCs9D7+WF1mV3IDBNetWAzbCslWl5FeyjqxU5XNSkB1BwIgHdn6rVhSE6NcnIiDd5tyIjIwnlddJNLbd0alVPpcNWE="}]},"maintainers":[{"name":"joshuagross","email":"josh@spandex.io"}]},"1.1.14":{"name":"serverswap","version":"1.1.14","private":false,"bin":{"serverswap":"./lib/serverswap.js","serverswap-deploy":"./lib/serverswap.js"},"engines":{"node":">=0.8.6"},"dependencies":{"async":"*"},"readme":"serverswap\n==========\n\nServerSwap is a small command-line utility, written in Node.js, that has one job: perform zero-downtime server restarts.\n\nGet it\n------\n`npm install -g serverswap`\n\nCommand-line Usage\n------------------\nStart your server like this:\n\nIf your server is server.js in the current directory: `serverswap node server.js` \n\nYou can also pass command-line arguments to your server: `serverswap node server.js a b c`\n\nYour server does not need to be running on Node.js, but I have only provided a client library for Node.js currently.\n\nServer Usage\n------------\nThe core intuition behind ServerSwap is that servers can communicate with ServerSwap to let it know when everything they need has been initialized, and\nall they need to do is bind to a port.\n\nWhen the ServerSwap instance receives the readyFor message, it will attempt to find an existing server, bring it down, and then send a message back to your new server that it can safely start up.\n\nOld servers are killed unceremoniously by default, but you can also set your server to respond to a `takeDown` message:\n\n```\n// server.js\n// Start with: serverswap server.js\nvar http = require('http')\n  , serverswap = require('../');\n\n// connect to databases\n// ...\n// load some more stuff\n// ...\n\nserverswap.readyFor(':8080', function () {\n  var server = http.createServer(function (req, res) {\n    res.writeHead(200, { 'Content-Type': 'text/plain' });\n    res.end(\"Hello World!\\n\");\n  }).listen(8080);\n\n  console.log('Listening on port 8080');\n\n  serverswap.onTakedown(':8080', function () {\n    // Stop taking new connections on port 80\n    console.log('Took down port 8080');\n    server.close();\n    // Give existing requests 5 seconds to finish processing\n    setTimeout(function () {\n      process.exit(0);\n    }, 5*1000);\n  });\n})\n```\n\nYou can send as many `readyFor` and `onTakedown` messages as you want for a staggered server deploy. `serverswap` will keep running until the older server process exits.\n\nMotivation\n----------\nWhile working on SpanDeX.io I would often need to deploy code to our production servers, which resulted in (at worst) 30 seconds to (at best) 6 seconds of downtime in which users would be disconnected from documents and the server would appear dead to the outside world.\n\nI'm sure I wasn't the first person to think of this, but I had a simple intuition: just don't take down the old server process until the new server process is ready to listen on an HTTP port. Between deploys and server restarts, this result in close to 0 milliseconds of downtime.\n\nCredit\n------\nDeveloped and maintained by Joshua Gross <josh@spandex.io> for SpanDeX.io.\n\nLicense\n-------\nMIT.\n","_id":"serverswap@1.1.14","description":"serverswap ==========","dist":{"shasum":"4ea830c443a6a1dbe3ee3fa8e36cf73461d8bb72","tarball":"https://registry.npmjs.org/serverswap/-/serverswap-1.1.14.tgz","integrity":"sha512-1Txt31RCcEU2bzapMO16fBo1k4EOraMhtqpKgc+U1ErqnZFhllq8e33UuN7Vqr24Y8si4SBK5pNu6eDhSREqsg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDOPKu032p/CF5aAJA1MCC0aOgnaZtkdNW12mMgryNW4AIhAJM6Qzyp9c4BIbVjYdRV9iDKtkG+/tFrKVkS7QtXRNnR"}]},"maintainers":[{"name":"joshuagross","email":"josh@spandex.io"}]},"1.1.15":{"name":"serverswap","version":"1.1.15","private":false,"bin":{"serverswap":"./lib/serverswap.js","serverswap-deploy":"./lib/serverswap.js"},"engines":{"node":">=0.8.6"},"dependencies":{"async":"*"},"readme":"serverswap\n==========\n\nServerSwap is a small command-line utility, written in Node.js, that has one job: perform zero-downtime server restarts.\n\nGet it\n------\n`npm install -g serverswap`\n\nCommand-line Usage\n------------------\nStart your server like this:\n\nIf your server is server.js in the current directory: `serverswap node server.js` \n\nYou can also pass command-line arguments to your server: `serverswap node server.js a b c`\n\nYour server does not need to be running on Node.js, but I have only provided a client library for Node.js currently.\n\nServer Usage\n------------\nThe core intuition behind ServerSwap is that servers can communicate with ServerSwap to let it know when everything they need has been initialized, and\nall they need to do is bind to a port.\n\nWhen the ServerSwap instance receives the readyFor message, it will attempt to find an existing server, bring it down, and then send a message back to your new server that it can safely start up.\n\nOld servers are killed unceremoniously by default, but you can also set your server to respond to a `takeDown` message:\n\n```\n// server.js\n// Start with: serverswap server.js\nvar http = require('http')\n  , serverswap = require('../');\n\n// connect to databases\n// ...\n// load some more stuff\n// ...\n\nserverswap.readyFor(':8080', function () {\n  var server = http.createServer(function (req, res) {\n    res.writeHead(200, { 'Content-Type': 'text/plain' });\n    res.end(\"Hello World!\\n\");\n  }).listen(8080);\n\n  console.log('Listening on port 8080');\n\n  serverswap.onTakedown(':8080', function () {\n    // Stop taking new connections on port 80\n    console.log('Took down port 8080');\n    server.close();\n    // Give existing requests 5 seconds to finish processing\n    setTimeout(function () {\n      process.exit(0);\n    }, 5*1000);\n  });\n})\n```\n\nYou can send as many `readyFor` and `onTakedown` messages as you want for a staggered server deploy. `serverswap` will keep running until the older server process exits.\n\nMotivation\n----------\nWhile working on SpanDeX.io I would often need to deploy code to our production servers, which resulted in (at worst) 30 seconds to (at best) 6 seconds of downtime in which users would be disconnected from documents and the server would appear dead to the outside world.\n\nI'm sure I wasn't the first person to think of this, but I had a simple intuition: just don't take down the old server process until the new server process is ready to listen on an HTTP port. Between deploys and server restarts, this result in close to 0 milliseconds of downtime.\n\nCredit\n------\nDeveloped and maintained by Joshua Gross <josh@spandex.io> for SpanDeX.io.\n\nLicense\n-------\nMIT.\n","_id":"serverswap@1.1.15","description":"serverswap ==========","dist":{"shasum":"9fee585b15f90d510a5490f8b2702aa13666aebd","tarball":"https://registry.npmjs.org/serverswap/-/serverswap-1.1.15.tgz","integrity":"sha512-6k/bY6JLEQadYnu78MRDQZIZRYBYgZ+l+7lH5/dlQE9TmLJ9b4InmN44s4n7lcxTEwHk+lNBJwur3gMNdZQTNg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDhBmx4DPOxb08QWfHzi7YaKzQKqepjlCwV+3qgofjN4QIhAPnGhQ9Gdk/8VC7uky+69cu+wtqQuizDZNFEEucWEFj2"}]},"maintainers":[{"name":"joshuagross","email":"josh@spandex.io"}]},"1.1.16":{"name":"serverswap","version":"1.1.16","private":false,"bin":{"serverswap":"./lib/serverswap.js","serverswap-deploy":"./lib/serverswap.js"},"engines":{"node":">=0.8.6"},"dependencies":{"async":"*"},"readme":"serverswap\n==========\n\nServerSwap is a small command-line utility, written in Node.js, that has one job: perform zero-downtime server restarts.\n\nGet it\n------\n`npm install -g serverswap`\n\nCommand-line Usage\n------------------\nStart your server like this:\n\nIf your server is server.js in the current directory: `serverswap node server.js` \n\nYou can also pass command-line arguments to your server: `serverswap node server.js a b c`\n\nYour server does not need to be running on Node.js, but I have only provided a client library for Node.js currently.\n\nServer Usage\n------------\nThe core intuition behind ServerSwap is that servers can communicate with ServerSwap to let it know when everything they need has been initialized, and\nall they need to do is bind to a port.\n\nWhen the ServerSwap instance receives the readyFor message, it will attempt to find an existing server, bring it down, and then send a message back to your new server that it can safely start up.\n\nOld servers are killed unceremoniously by default, but you can also set your server to respond to a `takeDown` message:\n\n```\n// server.js\n// Start with: serverswap server.js\nvar http = require('http')\n  , serverswap = require('../');\n\n// connect to databases\n// ...\n// load some more stuff\n// ...\n\nserverswap.readyFor(':8080', function () {\n  var server = http.createServer(function (req, res) {\n    res.writeHead(200, { 'Content-Type': 'text/plain' });\n    res.end(\"Hello World!\\n\");\n  }).listen(8080);\n\n  console.log('Listening on port 8080');\n\n  serverswap.onTakedown(':8080', function () {\n    // Stop taking new connections on port 80\n    console.log('Took down port 8080');\n    server.close();\n    // Give existing requests 5 seconds to finish processing\n    setTimeout(function () {\n      process.exit(0);\n    }, 5*1000);\n  });\n})\n```\n\nYou can send as many `readyFor` and `onTakedown` messages as you want for a staggered server deploy. `serverswap` will keep running until the older server process exits.\n\nMotivation\n----------\nWhile working on SpanDeX.io I would often need to deploy code to our production servers, which resulted in (at worst) 30 seconds to (at best) 6 seconds of downtime in which users would be disconnected from documents and the server would appear dead to the outside world.\n\nI'm sure I wasn't the first person to think of this, but I had a simple intuition: just don't take down the old server process until the new server process is ready to listen on an HTTP port. Between deploys and server restarts, this result in close to 0 milliseconds of downtime.\n\nCredit\n------\nDeveloped and maintained by Joshua Gross <josh@spandex.io> for SpanDeX.io.\n\nLicense\n-------\nMIT.\n","_id":"serverswap@1.1.16","description":"serverswap ==========","dist":{"shasum":"68be08d8b15dec702341bea510d194ed0adf5d73","tarball":"https://registry.npmjs.org/serverswap/-/serverswap-1.1.16.tgz","integrity":"sha512-2V+oh3xmPM1haKsbHEYhDUep9D0OX+2pkoxNa6EDBp29OhAHORlj52zHG+iELpde71jB9ci9NzPrJSdxEHH+Mg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGzBHy/Mrxuq8LkoGEyu1RBckOrQtlPiCcu+Iq5YRY95AiAstuAGkpOPbI35o3in8oycOz68CPfl4ycTsjMtEJqjBg=="}]},"maintainers":[{"name":"joshuagross","email":"josh@spandex.io"}]},"1.1.17":{"name":"serverswap","version":"1.1.17","private":false,"bin":{"serverswap":"./lib/serverswap.js","serverswap-deploy":"./lib/serverswap.js"},"engines":{"node":">=0.8.6"},"dependencies":{"async":"*"},"readme":"serverswap\n==========\n\nServerSwap is a small command-line utility, written in Node.js, that has one job: perform zero-downtime server restarts.\n\nGet it\n------\n`npm install -g serverswap`\n\nCommand-line Usage\n------------------\nStart your server like this:\n\nIf your server is server.js in the current directory: `serverswap node server.js` \n\nYou can also pass command-line arguments to your server: `serverswap node server.js a b c`\n\nYour server does not need to be running on Node.js, but I have only provided a client library for Node.js currently.\n\nServer Usage\n------------\nThe core intuition behind ServerSwap is that servers can communicate with ServerSwap to let it know when everything they need has been initialized, and\nall they need to do is bind to a port.\n\nWhen the ServerSwap instance receives the readyFor message, it will attempt to find an existing server, bring it down, and then send a message back to your new server that it can safely start up.\n\nOld servers are killed unceremoniously by default, but you can also set your server to respond to a `takeDown` message:\n\n```\n// server.js\n// Start with: serverswap server.js\nvar http = require('http')\n  , serverswap = require('../');\n\n// connect to databases\n// ...\n// load some more stuff\n// ...\n\nserverswap.readyFor(':8080', function () {\n  var server = http.createServer(function (req, res) {\n    res.writeHead(200, { 'Content-Type': 'text/plain' });\n    res.end(\"Hello World!\\n\");\n  }).listen(8080);\n\n  console.log('Listening on port 8080');\n\n  serverswap.onTakedown(':8080', function () {\n    // Stop taking new connections on port 80\n    console.log('Took down port 8080');\n    server.close();\n    // Give existing requests 5 seconds to finish processing\n    setTimeout(function () {\n      process.exit(0);\n    }, 5*1000);\n  });\n})\n```\n\nYou can send as many `readyFor` and `onTakedown` messages as you want for a staggered server deploy. `serverswap` will keep running until the older server process exits.\n\nMotivation\n----------\nWhile working on SpanDeX.io I would often need to deploy code to our production servers, which resulted in (at worst) 30 seconds to (at best) 6 seconds of downtime in which users would be disconnected from documents and the server would appear dead to the outside world.\n\nI'm sure I wasn't the first person to think of this, but I had a simple intuition: just don't take down the old server process until the new server process is ready to listen on an HTTP port. Between deploys and server restarts, this result in close to 0 milliseconds of downtime.\n\nCredit\n------\nDeveloped and maintained by Joshua Gross <josh@spandex.io> for SpanDeX.io.\n\nLicense\n-------\nMIT.\n","_id":"serverswap@1.1.17","description":"serverswap ==========","dist":{"shasum":"930ef81249e9ab4926582d78a8393f846b04fabd","tarball":"https://registry.npmjs.org/serverswap/-/serverswap-1.1.17.tgz","integrity":"sha512-vE6GHN+T2IO2JSJIuD0o4YRmZayJHmR5tpj+iJ6rxc5j3Pz6cWd6eO1zHAXK2vQ3x8nUNLsVBCdE0YoGHgWbBQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBcdky/e8E2yLAbWZ7UYHm5UE+EJBQzEMJcFVVocElNEAiEA0xdfM3yUfPF/nW4APNBf0r2gYAgpuAo9kzBpKqx3KuA="}]},"maintainers":[{"name":"joshuagross","email":"josh@spandex.io"}]},"1.1.18":{"name":"serverswap","version":"1.1.18","private":false,"bin":{"serverswap":"./lib/serverswap.js","serverswap-deploy":"./lib/serverswap.js"},"engines":{"node":">=0.8.6"},"dependencies":{"async":"*"},"readme":"serverswap\n==========\n\nServerSwap is a small command-line utility, written in Node.js, that has one job: perform zero-downtime server restarts.\n\nGet it\n------\n`npm install -g serverswap`\n\nCommand-line Usage\n------------------\nStart your server like this:\n\nIf your server is server.js in the current directory: `serverswap node server.js` \n\nYou can also pass command-line arguments to your server: `serverswap node server.js a b c`\n\nYour server does not need to be running on Node.js, but I have only provided a client library for Node.js currently.\n\nServer Usage\n------------\nThe core intuition behind ServerSwap is that servers can communicate with ServerSwap to let it know when everything they need has been initialized, and\nall they need to do is bind to a port.\n\nWhen the ServerSwap instance receives the readyFor message, it will attempt to find an existing server, bring it down, and then send a message back to your new server that it can safely start up.\n\nOld servers are killed unceremoniously by default, but you can also set your server to respond to a `takeDown` message:\n\n```\n// server.js\n// Start with: serverswap server.js\nvar http = require('http')\n  , serverswap = require('../');\n\n// connect to databases\n// ...\n// load some more stuff\n// ...\n\nserverswap.readyFor(':8080', function () {\n  var server = http.createServer(function (req, res) {\n    res.writeHead(200, { 'Content-Type': 'text/plain' });\n    res.end(\"Hello World!\\n\");\n  }).listen(8080);\n\n  console.log('Listening on port 8080');\n\n  serverswap.onTakedown(':8080', function () {\n    // Stop taking new connections on port 80\n    console.log('Took down port 8080');\n    server.close();\n    // Give existing requests 5 seconds to finish processing\n    setTimeout(function () {\n      process.exit(0);\n    }, 5*1000);\n  });\n})\n```\n\nYou can send as many `readyFor` and `onTakedown` messages as you want for a staggered server deploy. `serverswap` will keep running until the older server process exits.\n\nMotivation\n----------\nWhile working on SpanDeX.io I would often need to deploy code to our production servers, which resulted in (at worst) 30 seconds to (at best) 6 seconds of downtime in which users would be disconnected from documents and the server would appear dead to the outside world.\n\nI'm sure I wasn't the first person to think of this, but I had a simple intuition: just don't take down the old server process until the new server process is ready to listen on an HTTP port. Between deploys and server restarts, this result in close to 0 milliseconds of downtime.\n\nCredit\n------\nDeveloped and maintained by Joshua Gross <josh@spandex.io> for SpanDeX.io.\n\nLicense\n-------\nMIT.\n","readmeFilename":"README.md","_id":"serverswap@1.1.18","description":"serverswap ==========","dist":{"shasum":"0014366b522e34b8a02e280ada17ccf26e717b84","tarball":"https://registry.npmjs.org/serverswap/-/serverswap-1.1.18.tgz","integrity":"sha512-yOp0xerqtY3rdoUEGjD+VR++79RgP1J7Tce4MPJfWYHVmFMNg112Wc92aoYimCoEMtJChvO+akFRVVWCmD705w==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCKaVAlnVI+Mz5xp93U7nLRRV/KzMMZr0WNEh4e0SUSYgIgbewMChbW6rhdacdnof2s2yRK3/mqEb6EEjlcSu3sBOc="}]},"_npmVersion":"1.2.0","_npmUser":{"name":"joshuagross","email":"josh@spandex.io"},"maintainers":[{"name":"joshuagross","email":"josh@spandex.io"}]},"1.1.19":{"name":"serverswap","version":"1.1.19","private":false,"bin":{"serverswap":"./lib/serverswap.js","serverswap-deploy":"./lib/serverswap.js"},"engines":{"node":">=0.8.6"},"dependencies":{"async":"*"},"readme":"serverswap\n==========\n\nServerSwap is a small command-line utility, written in Node.js, that has one job: perform zero-downtime server restarts.\n\nGet it\n------\n`npm install -g serverswap`\n\nCommand-line Usage\n------------------\nStart your server like this:\n\nIf your server is server.js in the current directory: `serverswap node server.js` \n\nYou can also pass command-line arguments to your server: `serverswap node server.js a b c`\n\nYour server does not need to be running on Node.js, but I have only provided a client library for Node.js currently.\n\nServer Usage\n------------\nThe core intuition behind ServerSwap is that servers can communicate with ServerSwap to let it know when everything they need has been initialized, and\nall they need to do is bind to a port.\n\nWhen the ServerSwap instance receives the readyFor message, it will attempt to find an existing server, bring it down, and then send a message back to your new server that it can safely start up.\n\nOld servers are killed unceremoniously by default, but you can also set your server to respond to a `takeDown` message:\n\n```\n// server.js\n// Start with: serverswap server.js\nvar http = require('http')\n  , serverswap = require('../');\n\n// connect to databases\n// ...\n// load some more stuff\n// ...\n\nserverswap.readyFor(':8080', function () {\n  var server = http.createServer(function (req, res) {\n    res.writeHead(200, { 'Content-Type': 'text/plain' });\n    res.end(\"Hello World!\\n\");\n  }).listen(8080);\n\n  console.log('Listening on port 8080');\n\n  serverswap.onTakedown(':8080', function () {\n    // Stop taking new connections on port 80\n    console.log('Took down port 8080');\n    server.close();\n    // Give existing requests 5 seconds to finish processing\n    setTimeout(function () {\n      process.exit(0);\n    }, 5*1000);\n  });\n})\n```\n\nYou can send as many `readyFor` and `onTakedown` messages as you want for a staggered server deploy. `serverswap` will keep running until the older server process exits.\n\nMotivation\n----------\nWhile working on SpanDeX.io I would often need to deploy code to our production servers, which resulted in (at worst) 30 seconds to (at best) 6 seconds of downtime in which users would be disconnected from documents and the server would appear dead to the outside world.\n\nI'm sure I wasn't the first person to think of this, but I had a simple intuition: just don't take down the old server process until the new server process is ready to listen on an HTTP port. Between deploys and server restarts, this result in close to 0 milliseconds of downtime.\n\nCredit\n------\nDeveloped and maintained by Joshua Gross <josh@spandex.io> for SpanDeX.io.\n\nLicense\n-------\nMIT.\n","readmeFilename":"README.md","_id":"serverswap@1.1.19","description":"serverswap ==========","dist":{"shasum":"a8f470a1a700caab5a60997542e6e27a95b6d994","tarball":"https://registry.npmjs.org/serverswap/-/serverswap-1.1.19.tgz","integrity":"sha512-TIFcWK2Jboruyv3gvAiXx93qBC4HZaOZb3Z13QELzqGDgImgHaIWDLBBpgGd64h/6gxerI6U1+0QYeY29ioUBQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDXLf4t1ad0IDkbtxBWBCd5Wo4/PMestRDKWEt4uG70MwIgLmOVbyMpgU05WSZPbZMMO80o7Af9pXUScRlY1iTW+Zo="}]},"_npmVersion":"1.2.0","_npmUser":{"name":"joshuagross","email":"josh@spandex.io"},"maintainers":[{"name":"joshuagross","email":"josh@spandex.io"}]},"1.1.20":{"name":"serverswap","version":"1.1.20","private":false,"bin":{"serverswap":"./lib/serverswap.js","serverswap-deploy":"./lib/serverswap.js"},"engines":{"node":">=0.8.6"},"dependencies":{"async":"*"},"readme":"serverswap\n==========\n\nServerSwap is a small command-line utility, written in Node.js, that has one job: perform zero-downtime server restarts.\n\nGet it\n------\n`npm install -g serverswap`\n\nCommand-line Usage\n------------------\nStart your server like this:\n\nIf your server is server.js in the current directory: `serverswap node server.js` \n\nYou can also pass command-line arguments to your server: `serverswap node server.js a b c`\n\nYour server does not need to be running on Node.js, but I have only provided a client library for Node.js currently.\n\nServer Usage\n------------\nThe core intuition behind ServerSwap is that servers can communicate with ServerSwap to let it know when everything they need has been initialized, and\nall they need to do is bind to a port.\n\nWhen the ServerSwap instance receives the readyFor message, it will attempt to find an existing server, bring it down, and then send a message back to your new server that it can safely start up.\n\nOld servers are killed unceremoniously by default, but you can also set your server to respond to a `takeDown` message:\n\n```\n// server.js\n// Start with: serverswap server.js\nvar http = require('http')\n  , serverswap = require('../');\n\n// connect to databases\n// ...\n// load some more stuff\n// ...\n\nserverswap.readyFor(':8080', function () {\n  var server = http.createServer(function (req, res) {\n    res.writeHead(200, { 'Content-Type': 'text/plain' });\n    res.end(\"Hello World!\\n\");\n  }).listen(8080);\n\n  console.log('Listening on port 8080');\n\n  serverswap.onTakedown(':8080', function () {\n    // Stop taking new connections on port 80\n    console.log('Took down port 8080');\n    server.close();\n    // Give existing requests 5 seconds to finish processing\n    setTimeout(function () {\n      process.exit(0);\n    }, 5*1000);\n  });\n})\n```\n\nYou can send as many `readyFor` and `onTakedown` messages as you want for a staggered server deploy. `serverswap` will keep running until the older server process exits.\n\nDeploy mode\n-----------\nYou can also run ServerSwap in deploy mode by running `serverswap-deploy`. It will keep running either until the processes it spawns dies, either by\nfailure or replacement. \n\nMotivation\n----------\nWhile working on SpanDeX.io I would often need to deploy code to our production servers, which resulted in (at worst) 30 seconds to (at best) 6 seconds of downtime in which users would be disconnected from documents and the server would appear dead to the outside world.\n\nI'm sure I wasn't the first person to think of this, but I had a simple intuition: just don't take down the old server process until the new server process is ready to listen on an HTTP port. Between deploys and server restarts, this result in close to 0 milliseconds of downtime.\n\nCredit\n------\nDeveloped and maintained by Joshua Gross <josh@spandex.io> for SpanDeX.io.\n\nLicense\n-------\nMIT.\n","readmeFilename":"README.md","_id":"serverswap@1.1.20","description":"serverswap ==========","dist":{"shasum":"d7cdd48532cbb2d21d9014f7b62462b2a083b5b8","tarball":"https://registry.npmjs.org/serverswap/-/serverswap-1.1.20.tgz","integrity":"sha512-qZJ57vbOjTBPodTWUiffEXoPMK0toXVbJ6MqFN8ZEl/UouFDfr4GQMHTc0OVgcq+yjKl/VVYt0NIVBd0GIQe0Q==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHp8brip+btG33rZ0bXuIPStDJ2EHK71kCYN19Frv6zsAiBF7WmMeH0G6ITL175kfMorPlcgIQY9H8U/5j47XyWucg=="}]},"_npmVersion":"1.2.0","_npmUser":{"name":"joshuagross","email":"josh@spandex.io"},"maintainers":[{"name":"joshuagross","email":"josh@spandex.io"}]},"1.1.21":{"name":"serverswap","version":"1.1.21","private":false,"bin":{"serverswap":"./lib/serverswap.js","serverswap-deploy":"./lib/serverswap.js"},"engines":{"node":">=0.8.6"},"dependencies":{"async":"*"},"readme":"serverswap\n==========\n\nServerSwap is a small command-line utility, written in Node.js, that has one job: perform zero-downtime server restarts.\n\nGet it\n------\n`npm install -g serverswap`\n\nCommand-line Usage\n------------------\nStart your server like this:\n\nIf your server is server.js in the current directory: `serverswap node server.js` \n\nYou can also pass command-line arguments to your server: `serverswap node server.js a b c`\n\nYour server does not need to be running on Node.js, but I have only provided a client library for Node.js currently.\n\nServer Usage\n------------\nThe core intuition behind ServerSwap is that servers can communicate with ServerSwap to let it know when everything they need has been initialized, and\nall they need to do is bind to a port.\n\nWhen the ServerSwap instance receives the readyFor message, it will attempt to find an existing server, bring it down, and then send a message back to your new server that it can safely start up.\n\nOld servers are killed unceremoniously by default, but you can also set your server to respond to a `takeDown` message:\n\n```\n// server.js\n// Start with: serverswap server.js\nvar http = require('http')\n  , serverswap = require('../');\n\n// connect to databases\n// ...\n// load some more stuff\n// ...\n\nserverswap.readyFor(':8080', function () {\n  var server = http.createServer(function (req, res) {\n    res.writeHead(200, { 'Content-Type': 'text/plain' });\n    res.end(\"Hello World!\\n\");\n  }).listen(8080);\n\n  console.log('Listening on port 8080');\n\n  serverswap.onTakedown(':8080', function () {\n    // Stop taking new connections on port 80\n    console.log('Took down port 8080');\n    server.close();\n    // Give existing requests 5 seconds to finish processing\n    setTimeout(function () {\n      process.exit(0);\n    }, 5*1000);\n  });\n})\n```\n\nYou can send as many `readyFor` and `onTakedown` messages as you want for a staggered server deploy. `serverswap` will keep running until the older server process exits.\n\nDeploy mode\n-----------\nYou can also run ServerSwap in deploy mode by running `serverswap-deploy`. It will keep running either until the processes it spawns dies, either by\nfailure or replacement. \n\nMotivation\n----------\nWhile working on SpanDeX.io I would often need to deploy code to our production servers, which resulted in (at worst) 30 seconds to (at best) 6 seconds of downtime in which users would be disconnected from documents and the server would appear dead to the outside world.\n\nI'm sure I wasn't the first person to think of this, but I had a simple intuition: just don't take down the old server process until the new server process is ready to listen on an HTTP port. Between deploys and server restarts, this result in close to 0 milliseconds of downtime.\n\nCredit\n------\nDeveloped and maintained by Joshua Gross <josh@spandex.io> for SpanDeX.io.\n\nLicense\n-------\nMIT.\n","readmeFilename":"README.md","_id":"serverswap@1.1.21","description":"serverswap ==========","dist":{"shasum":"d1a6722f18ad4989f30e05900d74d50492a0164c","tarball":"https://registry.npmjs.org/serverswap/-/serverswap-1.1.21.tgz","integrity":"sha512-BU+bBQQfV7IB4BplAvej9Y7dozlgaIkTAxPOI4d56w+Ou6jdhl1dOL8IK6R30NpR+8PsJznYMAM3Hh8LXMgaTA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCpeDNxEWM9tyzdtsY7qqmQf2T98NwInyBQ/wEyRTzYzAIhAN5p18HPYAZZ1ewL/tCY2MxfrLZsKfYgs3OB7FDQH/Ov"}]},"_npmVersion":"1.2.0","_npmUser":{"name":"joshuagross","email":"josh@spandex.io"},"maintainers":[{"name":"joshuagross","email":"josh@spandex.io"}]},"1.1.22":{"name":"serverswap","version":"1.1.22","private":false,"bin":{"serverswap":"./lib/serverswap.js","serverswap-deploy":"./lib/serverswap.js"},"engines":{"node":">=0.8.6"},"dependencies":{"async":"*"},"readme":"serverswap\n==========\n\nServerSwap is a small command-line utility, written in Node.js, that has one job: perform zero-downtime server restarts.\n\nGet it\n------\n`npm install -g serverswap`\n\nCommand-line Usage\n------------------\nStart your server like this:\n\nIf your server is server.js in the current directory: `serverswap node server.js` \n\nYou can also pass command-line arguments to your server: `serverswap node server.js a b c`\n\nYour server does not need to be running on Node.js, but I have only provided a client library for Node.js currently.\n\nServer Usage\n------------\nThe core intuition behind ServerSwap is that servers can communicate with ServerSwap to let it know when everything they need has been initialized, and\nall they need to do is bind to a port.\n\nWhen the ServerSwap instance receives the readyFor message, it will attempt to find an existing server, bring it down, and then send a message back to your new server that it can safely start up.\n\nOld servers are killed unceremoniously by default, but you can also set your server to respond to a `takeDown` message:\n\n```\n// server.js\n// Start with: serverswap server.js\nvar http = require('http')\n  , serverswap = require('../');\n\n// connect to databases\n// ...\n// load some more stuff\n// ...\n\nserverswap.readyFor(':8080', function () {\n  var server = http.createServer(function (req, res) {\n    res.writeHead(200, { 'Content-Type': 'text/plain' });\n    res.end(\"Hello World!\\n\");\n  }).listen(8080);\n\n  console.log('Listening on port 8080');\n\n  serverswap.onTakedown(':8080', function () {\n    // Stop taking new connections on port 80\n    console.log('Took down port 8080');\n    server.close();\n    // Give existing requests 5 seconds to finish processing\n    setTimeout(function () {\n      process.exit(0);\n    }, 5*1000);\n  });\n})\n```\n\nYou can send as many `readyFor` and `onTakedown` messages as you want for a staggered server deploy. `serverswap` will keep running until the older server process exits.\n\nDeploy mode\n-----------\nYou can also run ServerSwap in deploy mode by running `serverswap-deploy`. It will keep running either until the processes it spawns dies, either by\nfailure or replacement. \n\nMotivation\n----------\nWhile working on SpanDeX.io I would often need to deploy code to our production servers, which resulted in (at worst) 30 seconds to (at best) 6 seconds of downtime in which users would be disconnected from documents and the server would appear dead to the outside world.\n\nI'm sure I wasn't the first person to think of this, but I had a simple intuition: just don't take down the old server process until the new server process is ready to listen on an HTTP port. Between deploys and server restarts, this result in close to 0 milliseconds of downtime.\n\nCredit\n------\nDeveloped and maintained by Joshua Gross <josh@spandex.io> for SpanDeX.io.\n\nLicense\n-------\nMIT.\n","readmeFilename":"README.md","_id":"serverswap@1.1.22","description":"serverswap ==========","dist":{"shasum":"bfbc8aa5d839a1ca8ac5453beb2282b4073d0f80","tarball":"https://registry.npmjs.org/serverswap/-/serverswap-1.1.22.tgz","integrity":"sha512-DK0QPCi1sK+qOiOhQOkKsORDC+2lEg5RPml3cIlWU33HbK8d9tVApB/4OgxHDuWIGf5m+qM2oDkFzrMc65NmUA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCfr5ZvI+U2wZEWz3gagai2lfhoFafRTJRgXhY7sEUVSgIgaX7fFQ6lZUxWWhdDUHsjeGfwIiJgBWh0YdCaZWa/zXY="}]},"_npmVersion":"1.2.0","_npmUser":{"name":"joshuagross","email":"josh@spandex.io"},"maintainers":[{"name":"joshuagross","email":"josh@spandex.io"}]},"1.1.23":{"name":"serverswap","version":"1.1.23","private":false,"bin":{"serverswap":"./lib/serverswap.js","serverswap-deploy":"./lib/serverswap.js"},"engines":{"node":">=0.8.6"},"dependencies":{"async":"*"},"readme":"serverswap\n==========\n\nServerSwap is a small command-line utility, written in Node.js, that has one job: perform zero-downtime server restarts.\n\nGet it\n------\n`npm install -g serverswap`\n\nCommand-line Usage\n------------------\nStart your server like this:\n\nIf your server is server.js in the current directory: `serverswap node server.js` \n\nYou can also pass command-line arguments to your server: `serverswap node server.js a b c`\n\nYour server does not need to be running on Node.js, but I have only provided a client library for Node.js currently.\n\nServer Usage\n------------\nThe core intuition behind ServerSwap is that servers can communicate with ServerSwap to let it know when everything they need has been initialized, and\nall they need to do is bind to a port.\n\nWhen the ServerSwap instance receives the readyFor message, it will attempt to find an existing server, bring it down, and then send a message back to your new server that it can safely start up.\n\nOld servers are killed unceremoniously by default, but you can also set your server to respond to a `takeDown` message:\n\n```\n// server.js\n// Start with: serverswap server.js\nvar http = require('http')\n  , serverswap = require('../');\n\n// connect to databases\n// ...\n// load some more stuff\n// ...\n\nserverswap.readyFor(':8080', function () {\n  var server = http.createServer(function (req, res) {\n    res.writeHead(200, { 'Content-Type': 'text/plain' });\n    res.end(\"Hello World!\\n\");\n  }).listen(8080);\n\n  console.log('Listening on port 8080');\n\n  serverswap.onTakedown(':8080', function () {\n    // Stop taking new connections on port 80\n    console.log('Took down port 8080');\n    server.close();\n    // Give existing requests 5 seconds to finish processing\n    setTimeout(function () {\n      process.exit(0);\n    }, 5*1000);\n  });\n})\n```\n\nYou can send as many `readyFor` and `onTakedown` messages as you want for a staggered server deploy. `serverswap` will keep running until the older server process exits.\n\nDeploy mode\n-----------\nYou can also run ServerSwap in deploy mode by running `serverswap-deploy`. It will keep running either until the processes it spawns dies, either by\nfailure or replacement. \n\nMotivation\n----------\nWhile working on SpanDeX.io I would often need to deploy code to our production servers, which resulted in (at worst) 30 seconds to (at best) 6 seconds of downtime in which users would be disconnected from documents and the server would appear dead to the outside world.\n\nI'm sure I wasn't the first person to think of this, but I had a simple intuition: just don't take down the old server process until the new server process is ready to listen on an HTTP port. Between deploys and server restarts, this result in close to 0 milliseconds of downtime.\n\nCredit\n------\nDeveloped and maintained by Joshua Gross <josh@spandex.io> for SpanDeX.io.\n\nLicense\n-------\nMIT.\n","readmeFilename":"README.md","_id":"serverswap@1.1.23","description":"serverswap ==========","dist":{"shasum":"ba5b5beed1704af2c1817a351a48c4c3933ac536","tarball":"https://registry.npmjs.org/serverswap/-/serverswap-1.1.23.tgz","integrity":"sha512-L8gqT+AXWoAlp1/h3F0MgLY5+rJ9B8C8M9GQCLMmhviU3bp5mSvBMM53fDvt6zPNERhmraDTWdo8R5VIYMF0sw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEcADDU05aToNYGZ/i1KA0PXvWI4og+WqC4kaVfT2Km6AiEAmqBCiTtKpG5HUtGyF5/07LEgY3kqVHABgtxxl8nW/Ro="}]},"_npmVersion":"1.2.0","_npmUser":{"name":"joshuagross","email":"josh@spandex.io"},"maintainers":[{"name":"joshuagross","email":"josh@spandex.io"}]},"1.1.24":{"name":"serverswap","version":"1.1.24","private":false,"bin":{"serverswap":"./lib/serverswap.js","serverswap-deploy":"./lib/serverswap.js"},"engines":{"node":">=0.8.6"},"dependencies":{"async":"*"},"readme":"serverswap\n==========\n\nServerSwap is a small command-line utility, written in Node.js, that has one job: perform zero-downtime server restarts.\n\nGet it\n------\n`npm install -g serverswap`\n\nCommand-line Usage\n------------------\nStart your server like this:\n\nIf your server is server.js in the current directory: `serverswap node server.js` \n\nYou can also pass command-line arguments to your server: `serverswap node server.js a b c`\n\nYour server does not need to be running on Node.js, but I have only provided a client library for Node.js currently.\n\nServer Usage\n------------\nThe core intuition behind ServerSwap is that servers can communicate with ServerSwap to let it know when everything they need has been initialized, and\nall they need to do is bind to a port.\n\nWhen the ServerSwap instance receives the readyFor message, it will attempt to find an existing server, bring it down, and then send a message back to your new server that it can safely start up.\n\nOld servers are killed unceremoniously by default, but you can also set your server to respond to a `takeDown` message:\n\n```\n// server.js\n// Start with: serverswap server.js\nvar http = require('http')\n  , serverswap = require('../');\n\n// connect to databases\n// ...\n// load some more stuff\n// ...\n\nserverswap.readyFor(':8080', function () {\n  var server = http.createServer(function (req, res) {\n    res.writeHead(200, { 'Content-Type': 'text/plain' });\n    res.end(\"Hello World!\\n\");\n  }).listen(8080);\n\n  console.log('Listening on port 8080');\n\n  serverswap.onTakedown(':8080', function () {\n    // Stop taking new connections on port 80\n    console.log('Took down port 8080');\n    server.close();\n    // Give existing requests 5 seconds to finish processing\n    setTimeout(function () {\n      process.exit(0);\n    }, 5*1000);\n  });\n})\n```\n\nYou can send as many `readyFor` and `onTakedown` messages as you want for a staggered server deploy. `serverswap` will keep running until the older server process exits.\n\nDeploy mode\n-----------\nYou can also run ServerSwap in deploy mode by running `serverswap-deploy`. It will keep running either until the processes it spawns dies, either by\nfailure or replacement. \n\nMotivation\n----------\nWhile working on SpanDeX.io I would often need to deploy code to our production servers, which resulted in (at worst) 30 seconds to (at best) 6 seconds of downtime in which users would be disconnected from documents and the server would appear dead to the outside world.\n\nI'm sure I wasn't the first person to think of this, but I had a simple intuition: just don't take down the old server process until the new server process is ready to listen on an HTTP port. Between deploys and server restarts, this result in close to 0 milliseconds of downtime.\n\nCredit\n------\nDeveloped and maintained by Joshua Gross <josh@spandex.io> for SpanDeX.io.\n\nLicense\n-------\nMIT.\n","readmeFilename":"README.md","_id":"serverswap@1.1.24","description":"serverswap ==========","dist":{"shasum":"0d3fa093f3c67e02c791aa5437b97c4559cf1267","tarball":"https://registry.npmjs.org/serverswap/-/serverswap-1.1.24.tgz","integrity":"sha512-NUFLA6mhST2c1Ug30WyMn8hrafdxquqaop3CcSG1sloepLSTbsXrgvBCjALuandyfijQilWKNmPW0e8QF3rR2A==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHv7tUdcq5ZSO/vszBIIJQ1q7amPfggyEZQW12dw/xdrAiB+Mdd8LsTM4ipGojyeGXEPIL24+xQ6F9wLhRWEphvxwQ=="}]},"_npmVersion":"1.2.0","_npmUser":{"name":"joshuagross","email":"josh@spandex.io"},"maintainers":[{"name":"joshuagross","email":"josh@spandex.io"}]},"1.3.0":{"name":"serverswap","version":"1.3.0","private":false,"bin":{"serverswap":"./lib/serverswap.js","serverswap-deploy":"./lib/serverswap.js"},"engines":{"node":">=0.8.6"},"dependencies":{"async":"*"},"readme":"serverswap\n==========\n\nServerSwap is a small command-line utility, written in Node.js, that has one job: perform zero-downtime server restarts.\n\nGet it\n------\n`npm install -g serverswap`\n\nCommand-line Usage\n------------------\nStart your server like this:\n\nIf your server is server.js in the current directory: `serverswap node server.js` \n\nYou can also pass command-line arguments to your server: `serverswap node server.js a b c`\n\nYour server does not need to be running on Node.js, but I have only provided a client library for Node.js currently.\n\nServer Usage\n------------\nThe core intuition behind ServerSwap is that servers can communicate with ServerSwap to let it know when everything they need has been initialized, and\nall they need to do is bind to a port.\n\nWhen the ServerSwap instance receives the readyFor message, it will attempt to find an existing server, bring it down, and then send a message back to your new server that it can safely start up.\n\nOld servers are killed unceremoniously by default, but you can also set your server to respond to a `takeDown` message:\n\n```\n// server.js\n// Start with: serverswap server.js\nvar http = require('http')\n  , serverswap = require('../');\n\n// connect to databases\n// ...\n// load some more stuff\n// ...\n\nserverswap.readyFor(':8080', function () {\n  var server = http.createServer(function (req, res) {\n    res.writeHead(200, { 'Content-Type': 'text/plain' });\n    res.end(\"Hello World!\\n\");\n  }).listen(8080);\n\n  console.log('Listening on port 8080');\n\n  serverswap.onTakedown(':8080', function () {\n    // Stop taking new connections on port 80\n    console.log('Took down port 8080');\n    server.close();\n    // Give existing requests 5 seconds to finish processing\n    setTimeout(function () {\n      process.exit(0);\n    }, 5*1000);\n  });\n})\n```\n\nYou can send as many `readyFor` and `onTakedown` messages as you want for a staggered server deploy. `serverswap` will keep running until the older server process exits.\n\nDeploy mode\n-----------\nYou can also run ServerSwap in deploy mode by running `serverswap-deploy`. It will keep running either until the processes it spawns dies, either by\nfailure or replacement. \n\nMotivation\n----------\nWhile working on SpanDeX.io I would often need to deploy code to our production servers, which resulted in (at worst) 30 seconds to (at best) 6 seconds of downtime in which users would be disconnected from documents and the server would appear dead to the outside world.\n\nI'm sure I wasn't the first person to think of this, but I had a simple intuition: just don't take down the old server process until the new server process is ready to listen on an HTTP port. Between deploys and server restarts, this result in close to 0 milliseconds of downtime.\n\nCredit\n------\nDeveloped and maintained by Joshua Gross <josh@spandex.io> for SpanDeX.io.\n\nLicense\n-------\nMIT.\n","readmeFilename":"README.md","_id":"serverswap@1.3.0","description":"serverswap ==========","dist":{"shasum":"1a11aff21d79f959ddf958e4b6dc9c34ba35eac9","tarball":"https://registry.npmjs.org/serverswap/-/serverswap-1.3.0.tgz","integrity":"sha512-rUHGmB8irbJShVsideUvWZp117jtLQAUFdXGlQVFAYKH2u8NET2Zb8Cj/C3nkPi/Jj3gHU6ce5c1mCPKQ88ReA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDPMIzdSBFFhA7NM9BJ1/gXTRn9Kd3NeCkyV1EDZ5WdbAiAkQWBmpb2cEV0W1uNX3jzmhbyy0T8tfurqHrhrZxqsfg=="}]},"_npmVersion":"1.2.0","_npmUser":{"name":"joshuagross","email":"josh@spandex.io"},"maintainers":[{"name":"joshuagross","email":"josh@spandex.io"}]},"1.3.1":{"name":"serverswap","version":"1.3.1","private":false,"bin":{"serverswap":"./lib/serverswap.js","serverswap-deploy":"./lib/serverswap.js"},"engines":{"node":">=0.8.6"},"dependencies":{"async":"*"},"readme":"serverswap\n==========\n\nServerSwap is a small command-line utility, written in Node.js, that has one job: perform zero-downtime server restarts.\n\nGet it\n------\n`npm install -g serverswap`\n\nCommand-line Usage\n------------------\nStart your server like this:\n\nIf your server is server.js in the current directory: `serverswap node server.js` \n\nYou can also pass command-line arguments to your server: `serverswap node server.js a b c`\n\nYour server does not need to be running on Node.js, but I have only provided a client library for Node.js currently.\n\nServer Usage\n------------\nThe core intuition behind ServerSwap is that servers can communicate with ServerSwap to let it know when everything they need has been initialized, and\nall they need to do is bind to a port.\n\nWhen the ServerSwap instance receives the readyFor message, it will attempt to find an existing server, bring it down, and then send a message back to your new server that it can safely start up.\n\nOld servers are killed unceremoniously by default, but you can also set your server to respond to a `takeDown` message:\n\n```\n// server.js\n// Start with: serverswap server.js\nvar http = require('http')\n  , serverswap = require('../');\n\n// connect to databases\n// ...\n// load some more stuff\n// ...\n\nserverswap.readyFor(':8080', function () {\n  var server = http.createServer(function (req, res) {\n    res.writeHead(200, { 'Content-Type': 'text/plain' });\n    res.end(\"Hello World!\\n\");\n  }).listen(8080);\n\n  console.log('Listening on port 8080');\n\n  serverswap.onTakedown(':8080', function () {\n    // Stop taking new connections on port 80\n    console.log('Took down port 8080');\n    server.close();\n    // Give existing requests 5 seconds to finish processing\n    setTimeout(function () {\n      process.exit(0);\n    }, 5*1000);\n  });\n})\n```\n\nYou can send as many `readyFor` and `onTakedown` messages as you want for a staggered server deploy. `serverswap` will keep running until the older server process exits.\n\nDeploy mode\n-----------\nYou can also run ServerSwap in deploy mode by running `serverswap-deploy`. It will keep running either until the processes it spawns dies, either by\nfailure or replacement. \n\nMotivation\n----------\nWhile working on SpanDeX.io I would often need to deploy code to our production servers, which resulted in (at worst) 30 seconds to (at best) 6 seconds of downtime in which users would be disconnected from documents and the server would appear dead to the outside world.\n\nI'm sure I wasn't the first person to think of this, but I had a simple intuition: just don't take down the old server process until the new server process is ready to listen on an HTTP port. Between deploys and server restarts, this result in close to 0 milliseconds of downtime.\n\nCredit\n------\nDeveloped and maintained by Joshua Gross <josh@spandex.io> for SpanDeX.io.\n\nLicense\n-------\nMIT.\n","readmeFilename":"README.md","_id":"serverswap@1.3.1","description":"serverswap ==========","dist":{"shasum":"308d97847b45ee237e139d0aafb7b5f7df754af0","tarball":"https://registry.npmjs.org/serverswap/-/serverswap-1.3.1.tgz","integrity":"sha512-RnOg1rW1w9/U8nDe12Z/Y2Xsr+rHE5etpICk3IIg+ffPxrvoHYSjwoASWPo+/ZXAkz56gYRY2ESFLDikEFXSXg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEiMKnHHcedJ28NhO02FfP18Axdlp2GBQrIz91nUS3s/AiEAg9Rb/xTjUHkcXsa5PeyfcN1NkeQ2MLRQYuu89ICMnYE="}]},"_npmVersion":"1.2.0","_npmUser":{"name":"joshuagross","email":"josh@spandex.io"},"maintainers":[{"name":"joshuagross","email":"josh@spandex.io"}]},"1.4.0":{"name":"serverswap","version":"1.4.0","private":false,"bin":{"serverswap":"./lib/serverswap.js","serverswap-deploy":"./lib/serverswap.js"},"engines":{"node":">=0.8.6"},"dependencies":{"async":"*"},"readme":"serverswap\n==========\n\nServerSwap is a small command-line utility, written in Node.js, that has one job: perform zero-downtime server restarts.\n\nGet it\n------\n`npm install -g serverswap`\n\nCommand-line Usage\n------------------\nStart your server like this:\n\nIf your server is server.js in the current directory: `serverswap node server.js` \n\nYou can also pass command-line arguments to your server: `serverswap node server.js a b c`\n\nYour server does not need to be running on Node.js, but I have only provided a client library for Node.js currently.\n\nServer Usage\n------------\nThe core intuition behind ServerSwap is that servers can communicate with ServerSwap to let it know when everything they need has been initialized, and\nall they need to do is bind to a port.\n\nWhen the ServerSwap instance receives the readyFor message, it will attempt to find an existing server, bring it down, and then send a message back to your new server that it can safely start up.\n\nOld servers are killed unceremoniously by default, but you can also set your server to respond to a `takeDown` message:\n\n```\n// server.js\n// Start with: serverswap server.js\nvar http = require('http')\n  , serverswap = require('../');\n\n// connect to databases\n// ...\n// load some more stuff\n// ...\n\nserverswap.readyFor(':8080', function () {\n  var server = http.createServer(function (req, res) {\n    res.writeHead(200, { 'Content-Type': 'text/plain' });\n    res.end(\"Hello World!\\n\");\n  }).listen(8080);\n\n  console.log('Listening on port 8080');\n\n  serverswap.onTakedown(':8080', function () {\n    // Stop taking new connections on port 80\n    console.log('Took down port 8080');\n    server.close();\n    // Give existing requests 5 seconds to finish processing\n    setTimeout(function () {\n      process.exit(0);\n    }, 5*1000);\n  });\n})\n```\n\nYou can send as many `readyFor` and `onTakedown` messages as you want for a staggered server deploy. `serverswap` will keep running until the older server process exits.\n\nDeploy mode\n-----------\nYou can also run ServerSwap in deploy mode by running `serverswap-deploy`. It will keep running either until the processes it spawns dies, either by\nfailure or replacement. \n\nMotivation\n----------\nWhile working on SpanDeX.io I would often need to deploy code to our production servers, which resulted in (at worst) 30 seconds to (at best) 6 seconds of downtime in which users would be disconnected from documents and the server would appear dead to the outside world.\n\nI'm sure I wasn't the first person to think of this, but I had a simple intuition: just don't take down the old server process until the new server process is ready to listen on an HTTP port. Between deploys and server restarts, this result in close to 0 milliseconds of downtime.\n\nCredit\n------\nDeveloped and maintained by Joshua Gross <josh@spandex.io> for SpanDeX.io.\n\nLicense\n-------\nMIT.\n","readmeFilename":"README.md","_id":"serverswap@1.4.0","description":"serverswap ==========","dist":{"shasum":"7e377a0d32c73124bc78e959d97a684a9915aedf","tarball":"https://registry.npmjs.org/serverswap/-/serverswap-1.4.0.tgz","integrity":"sha512-DIsH47xXRgU5x5tIO0hhoEyjWDaLnw4S1zYV61z0+q3LCFgEBYmNJ0vIHN40aLp5tgWCKZWXQj7oKXr3wbf3EA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDf+X5A92p2N6G82r9EewsloqvXS23axIJN0MBdifjxjwIhALxF2ycuS10dzVmwMbssjKuNFYift3kwB454lgV3YTwP"}]},"_npmVersion":"1.2.0","_npmUser":{"name":"joshuagross","email":"josh@spandex.io"},"maintainers":[{"name":"joshuagross","email":"josh@spandex.io"}]},"1.4.1":{"name":"serverswap","version":"1.4.1","private":false,"bin":{"serverswap":"./lib/serverswap.js","serverswap-deploy":"./lib/serverswap.js"},"engines":{"node":">=0.8.6"},"dependencies":{"async":"*"},"readme":"serverswap\n==========\n\nServerSwap is a small command-line utility, written in Node.js, that has one job: perform zero-downtime server restarts.\n\nGet it\n------\n`npm install -g serverswap`\n\nCommand-line Usage\n------------------\nStart your server like this:\n\nIf your server is server.js in the current directory: `serverswap node server.js` \n\nYou can also pass command-line arguments to your server: `serverswap node server.js a b c`\n\nYour server does not need to be running on Node.js, but I have only provided a client library for Node.js currently.\n\nServer Usage\n------------\nThe core intuition behind ServerSwap is that servers can communicate with ServerSwap to let it know when everything they need has been initialized, and\nall they need to do is bind to a port.\n\nWhen the ServerSwap instance receives the readyFor message, it will attempt to find an existing server, bring it down, and then send a message back to your new server that it can safely start up.\n\nOld servers are killed unceremoniously by default, but you can also set your server to respond to a `takeDown` message:\n\n```\n// server.js\n// Start with: serverswap server.js\nvar http = require('http')\n  , serverswap = require('../');\n\n// connect to databases\n// ...\n// load some more stuff\n// ...\n\nserverswap.readyFor(':8080', function () {\n  var server = http.createServer(function (req, res) {\n    res.writeHead(200, { 'Content-Type': 'text/plain' });\n    res.end(\"Hello World!\\n\");\n  }).listen(8080);\n\n  console.log('Listening on port 8080');\n\n  serverswap.onTakedown(':8080', function () {\n    // Stop taking new connections on port 80\n    console.log('Took down port 8080');\n    server.close();\n    // Give existing requests 5 seconds to finish processing\n    setTimeout(function () {\n      process.exit(0);\n    }, 5*1000);\n  });\n})\n```\n\nYou can send as many `readyFor` and `onTakedown` messages as you want for a staggered server deploy. `serverswap` will keep running until the older server process exits.\n\nDeploy mode\n-----------\nYou can also run ServerSwap in deploy mode by running `serverswap-deploy`. It will keep running either until the processes it spawns dies, either by\nfailure or replacement. \n\nMotivation\n----------\nWhile working on SpanDeX.io I would often need to deploy code to our production servers, which resulted in (at worst) 30 seconds to (at best) 6 seconds of downtime in which users would be disconnected from documents and the server would appear dead to the outside world.\n\nI'm sure I wasn't the first person to think of this, but I had a simple intuition: just don't take down the old server process until the new server process is ready to listen on an HTTP port. Between deploys and server restarts, this result in close to 0 milliseconds of downtime.\n\nCredit\n------\nDeveloped and maintained by Joshua Gross <josh@spandex.io> for SpanDeX.io.\n\nLicense\n-------\nMIT.\n","readmeFilename":"README.md","_id":"serverswap@1.4.1","description":"serverswap ==========","dist":{"shasum":"1907654d2dfb67f5ff394d563343dac0af198271","tarball":"https://registry.npmjs.org/serverswap/-/serverswap-1.4.1.tgz","integrity":"sha512-jTs9NAO2w8FWuI7NlDWxKp636/c/7wDhmRaZmKVuHnNl8xNAnFfQrNrT2V3LYAVI6lA2AdP5q1R2jABQDhVeNw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDCN3oDt6IX+v8t96jHsodXxnRZ7DjThVnfX54pXtt6iQIgb9L8OwoJwE5UyATQGhQhAf+aV33xbQw5akoHZOFS2cg="}]},"_npmVersion":"1.2.0","_npmUser":{"name":"joshuagross","email":"josh@spandex.io"},"maintainers":[{"name":"joshuagross","email":"josh@spandex.io"}]},"1.4.2":{"name":"serverswap","version":"1.4.2","private":false,"bin":{"serverswap":"./lib/serverswap.js","serverswap-deploy":"./lib/serverswap.js"},"engines":{"node":">=0.8.6"},"dependencies":{"async":"*","semver":"*"},"readme":"serverswap\n==========\n\nServerSwap is a small command-line utility, written in Node.js, that has one job: perform zero-downtime server restarts.\n\nGet it\n------\n`npm install -g serverswap`\n\nCommand-line Usage\n------------------\nStart your server like this:\n\nIf your server is server.js in the current directory: `serverswap node server.js` \n\nYou can also pass command-line arguments to your server: `serverswap node server.js a b c`\n\nYour server does not need to be running on Node.js, but I have only provided a client library for Node.js currently.\n\nServer Usage\n------------\nThe core intuition behind ServerSwap is that servers can communicate with ServerSwap to let it know when everything they need has been initialized, and\nall they need to do is bind to a port.\n\nWhen the ServerSwap instance receives the readyFor message, it will attempt to find an existing server, bring it down, and then send a message back to your new server that it can safely start up.\n\nOld servers are killed unceremoniously by default, but you can also set your server to respond to a `takeDown` message:\n\n```\n// server.js\n// Start with: serverswap server.js\nvar http = require('http')\n  , serverswap = require('../');\n\n// connect to databases\n// ...\n// load some more stuff\n// ...\n\nserverswap.readyFor(':8080', function () {\n  var server = http.createServer(function (req, res) {\n    res.writeHead(200, { 'Content-Type': 'text/plain' });\n    res.end(\"Hello World!\\n\");\n  }).listen(8080);\n\n  console.log('Listening on port 8080');\n\n  serverswap.onTakedown(':8080', function () {\n    // Stop taking new connections on port 80\n    console.log('Took down port 8080');\n    server.close();\n    // Give existing requests 5 seconds to finish processing\n    setTimeout(function () {\n      process.exit(0);\n    }, 5*1000);\n  });\n})\n```\n\nYou can send as many `readyFor` and `onTakedown` messages as you want for a staggered server deploy. `serverswap` will keep running until the older server process exits.\n\nDeploy mode\n-----------\nYou can also run ServerSwap in deploy mode by running `serverswap-deploy`. It will keep running either until the processes it spawns dies, either by\nfailure or replacement. \n\nMotivation\n----------\nWhile working on SpanDeX.io I would often need to deploy code to our production servers, which resulted in (at worst) 30 seconds to (at best) 6 seconds of downtime in which users would be disconnected from documents and the server would appear dead to the outside world.\n\nI'm sure I wasn't the first person to think of this, but I had a simple intuition: just don't take down the old server process until the new server process is ready to listen on an HTTP port. Between deploys and server restarts, this result in close to 0 milliseconds of downtime.\n\nCredit\n------\nDeveloped and maintained by Joshua Gross <josh@spandex.io> for SpanDeX.io.\n\nLicense\n-------\nMIT.\n","readmeFilename":"README.md","_id":"serverswap@1.4.2","description":"serverswap ==========","dist":{"shasum":"918f4d4e2a20718b38448c5d1912728f9343cfe4","tarball":"https://registry.npmjs.org/serverswap/-/serverswap-1.4.2.tgz","integrity":"sha512-BfY3ZbPg852ktkrBxU9IZF1/73PP7G0NCWfvFkecHd4qZOeOzddSZZCUobAC8jsU1PsSOIqzHgHiDC+BL5F9aQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEUteJlbYHPB6XtnV3lvDM+lXIxUlWKdjhU8pl5JIu9CAiAqf4WVy0cMxL7LKGwDgtUfNgV68BAZSLz2r0wisngJoA=="}]},"_npmVersion":"1.2.0","_npmUser":{"name":"joshuagross","email":"josh@spandex.io"},"maintainers":[{"name":"joshuagross","email":"josh@spandex.io"}]},"1.4.3":{"name":"serverswap","version":"1.4.3","private":false,"bin":{"serverswap":"./lib/serverswap.js","serverswap-deploy":"./lib/serverswap.js"},"engines":{"node":">=0.8.6"},"dependencies":{"async":"*","semver":"*"},"readme":"serverswap\n==========\n\nServerSwap is a small command-line utility, written in Node.js, that has one job: perform zero-downtime server restarts.\n\nGet it\n------\n`npm install -g serverswap`\n\nCommand-line Usage\n------------------\nStart your server like this:\n\nIf your server is server.js in the current directory: `serverswap node server.js` \n\nYou can also pass command-line arguments to your server: `serverswap node server.js a b c`\n\nYour server does not need to be running on Node.js, but I have only provided a client library for Node.js currently.\n\nServer Usage\n------------\nThe core intuition behind ServerSwap is that servers can communicate with ServerSwap to let it know when everything they need has been initialized, and\nall they need to do is bind to a port.\n\nWhen the ServerSwap instance receives the readyFor message, it will attempt to find an existing server, bring it down, and then send a message back to your new server that it can safely start up.\n\nOld servers are killed unceremoniously by default, but you can also set your server to respond to a `takeDown` message:\n\n```\n// server.js\n// Start with: serverswap server.js\nvar http = require('http')\n  , serverswap = require('../');\n\n// connect to databases\n// ...\n// load some more stuff\n// ...\n\nserverswap.readyFor(':8080', function () {\n  var server = http.createServer(function (req, res) {\n    res.writeHead(200, { 'Content-Type': 'text/plain' });\n    res.end(\"Hello World!\\n\");\n  }).listen(8080);\n\n  console.log('Listening on port 8080');\n\n  serverswap.onTakedown(':8080', function () {\n    // Stop taking new connections on port 80\n    console.log('Took down port 8080');\n    server.close();\n    // Give existing requests 5 seconds to finish processing\n    setTimeout(function () {\n      process.exit(0);\n    }, 5*1000);\n  });\n})\n```\n\nYou can send as many `readyFor` and `onTakedown` messages as you want for a staggered server deploy. `serverswap` will keep running until the older server process exits.\n\nDeploy mode\n-----------\nYou can also run ServerSwap in deploy mode by running `serverswap-deploy`. It will keep running either until the processes it spawns dies, either by\nfailure or replacement. \n\nMotivation\n----------\nWhile working on SpanDeX.io I would often need to deploy code to our production servers, which resulted in (at worst) 30 seconds to (at best) 6 seconds of downtime in which users would be disconnected from documents and the server would appear dead to the outside world.\n\nI'm sure I wasn't the first person to think of this, but I had a simple intuition: just don't take down the old server process until the new server process is ready to listen on an HTTP port. Between deploys and server restarts, this result in close to 0 milliseconds of downtime.\n\nCredit\n------\nDeveloped and maintained by Joshua Gross <josh@spandex.io> for SpanDeX.io.\n\nLicense\n-------\nMIT.\n","readmeFilename":"README.md","_id":"serverswap@1.4.3","description":"serverswap ==========","dist":{"shasum":"cd0a6bbc002333ffd24017636a66a6e9cbb6377d","tarball":"https://registry.npmjs.org/serverswap/-/serverswap-1.4.3.tgz","integrity":"sha512-MnxVIW+4k787OxFWciO5Nb1B+H/+AJjLDKmPH/c3M9atc9O9yeZDwYzo8XvRuUoHj0eH9KVECRuhd+ysUkvbyg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFVAYJ3DIR6jz5hFaPJMudOZyHiTj8XDUxEiJDfbgCV1AiAuCgn6zca8+ifNAB6PMLT12J98d0C3XICwvkGBLYbDFw=="}]},"_npmVersion":"1.2.0","_npmUser":{"name":"joshuagross","email":"josh@spandex.io"},"maintainers":[{"name":"joshuagross","email":"josh@spandex.io"}]},"1.4.4":{"name":"serverswap","version":"1.4.4","private":false,"bin":{"serverswap":"./lib/serverswap.js","serverswap-deploy":"./lib/serverswap.js"},"engines":{"node":">=0.8.6"},"devDependencies":{"expect.js":"*","sinon":"*","ms":"*"},"dependencies":{"async":"*","semver":"*"},"readme":"serverswap\n==========\n\nServerSwap is a small command-line utility, written in Node.js, that has one job: perform zero-downtime server restarts.\n\nGet it\n------\n`npm install -g serverswap`\n\nCommand-line Usage\n------------------\nStart your server like this:\n\nIf your server is server.js in the current directory: `serverswap node server.js` \n\nYou can also pass command-line arguments to your server: `serverswap node server.js a b c`\n\nYour server does not need to be running on Node.js, but I have only provided a client library for Node.js currently.\n\nServer Usage\n------------\nThe core intuition behind ServerSwap is that servers can communicate with ServerSwap to let it know when everything they need has been initialized, and\nall they need to do is bind to a port.\n\nWhen the ServerSwap instance receives the readyFor message, it will attempt to find an existing server, bring it down, and then send a message back to your new server that it can safely start up.\n\nOld servers are killed unceremoniously by default, but you can also set your server to respond to a `takeDown` message:\n\n```\n// server.js\n// Start with: serverswap server.js\nvar http = require('http')\n  , serverswap = require('../');\n\n// connect to databases\n// ...\n// load some more stuff\n// ...\n\nserverswap.readyFor(':8080', function () {\n  var server = http.createServer(function (req, res) {\n    res.writeHead(200, { 'Content-Type': 'text/plain' });\n    res.end(\"Hello World!\\n\");\n  }).listen(8080);\n\n  console.log('Listening on port 8080');\n\n  serverswap.onTakedown(':8080', function () {\n    // Stop taking new connections on port 80\n    console.log('Took down port 8080');\n    server.close();\n    // Give existing requests 5 seconds to finish processing\n    setTimeout(function () {\n      process.exit(0);\n    }, 5*1000);\n  });\n})\n```\n\nYou can send as many `readyFor` and `onTakedown` messages as you want for a staggered server deploy. `serverswap` will keep running until the older server process exits.\n\nDeploy mode\n-----------\nYou can also run ServerSwap in deploy mode by running `serverswap-deploy`. It will keep running either until the processes it spawns dies, either by\nfailure or replacement. \n\nMotivation\n----------\nWhile working on SpanDeX.io I would often need to deploy code to our production servers, which resulted in (at worst) 30 seconds to (at best) 6 seconds of downtime in which users would be disconnected from documents and the server would appear dead to the outside world.\n\nI'm sure I wasn't the first person to think of this, but I had a simple intuition: just don't take down the old server process until the new server process is ready to listen on an HTTP port. Between deploys and server restarts, this result in close to 0 milliseconds of downtime.\n\nCredit\n------\nDeveloped and maintained by Joshua Gross <josh@spandex.io> for SpanDeX.io.\n\nLicense\n-------\nMIT.\n","readmeFilename":"README.md","_id":"serverswap@1.4.4","description":"serverswap ==========","dist":{"shasum":"5730cc88334fbe7dae0ebcf5491604b7639a989e","tarball":"https://registry.npmjs.org/serverswap/-/serverswap-1.4.4.tgz","integrity":"sha512-vPCw2Cr4FKKQHoi5gQSp17uT8jvz98POE0DomDfbXeLcRMhuRmqgxPnNKJoLQEBIpNF8NSZuq0UwT90OIILk9g==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCaeDeoNWVkaa1fvcv42LYf8gRMGXTM4b+qnCQOH9lEPQIhANpwxYxeKe09zpB2eMjyL3Wlr424l8E2SufMMx0kmI0W"}]},"_npmVersion":"1.2.0","_npmUser":{"name":"joshuagross","email":"josh@spandex.io"},"maintainers":[{"name":"joshuagross","email":"josh@spandex.io"}]},"1.4.5":{"name":"serverswap","version":"1.4.5","private":false,"bin":{"serverswap":"./lib/serverswap.js","serverswap-deploy":"./lib/serverswap.js"},"engines":{"node":">=0.8.6"},"devDependencies":{"expect.js":"*","sinon":"*","ms":"*"},"dependencies":{"async":"*","semver":"*"},"readme":"serverswap\n==========\n\nServerSwap is a small command-line utility, written in Node.js, that has one job: perform zero-downtime server restarts.\n\nGet it\n------\n`npm install -g serverswap`\n\nCommand-line Usage\n------------------\nStart your server like this:\n\nIf your server is server.js in the current directory: `serverswap node server.js` \n\nYou can also pass command-line arguments to your server: `serverswap node server.js a b c`\n\nYour server does not need to be running on Node.js, but I have only provided a client library for Node.js currently.\n\nServer Usage\n------------\nThe core intuition behind ServerSwap is that servers can communicate with ServerSwap to let it know when everything they need has been initialized, and\nall they need to do is bind to a port.\n\nWhen the ServerSwap instance receives the readyFor message, it will attempt to find an existing server, bring it down, and then send a message back to your new server that it can safely start up.\n\nOld servers are killed unceremoniously by default, but you can also set your server to respond to a `takeDown` message:\n\n```\n// server.js\n// Start with: serverswap server.js\nvar http = require('http')\n  , serverswap = require('../');\n\n// connect to databases\n// ...\n// load some more stuff\n// ...\n\nserverswap.readyFor(':8080', function () {\n  var server = http.createServer(function (req, res) {\n    res.writeHead(200, { 'Content-Type': 'text/plain' });\n    res.end(\"Hello World!\\n\");\n  }).listen(8080);\n\n  console.log('Listening on port 8080');\n\n  serverswap.onTakedown(':8080', function () {\n    // Stop taking new connections on port 80\n    console.log('Took down port 8080');\n    server.close();\n    // Give existing requests 5 seconds to finish processing\n    setTimeout(function () {\n      process.exit(0);\n    }, 5*1000);\n  });\n})\n```\n\nYou can send as many `readyFor` and `onTakedown` messages as you want for a staggered server deploy. `serverswap` will keep running until the older server process exits.\n\nDeploy mode\n-----------\nYou can also run ServerSwap in deploy mode by running `serverswap-deploy`. It will keep running either until the processes it spawns dies, either by\nfailure or replacement. \n\nMotivation\n----------\nWhile working on SpanDeX.io I would often need to deploy code to our production servers, which resulted in (at worst) 30 seconds to (at best) 6 seconds of downtime in which users would be disconnected from documents and the server would appear dead to the outside world.\n\nI'm sure I wasn't the first person to think of this, but I had a simple intuition: just don't take down the old server process until the new server process is ready to listen on an HTTP port. Between deploys and server restarts, this result in close to 0 milliseconds of downtime.\n\nCredit\n------\nDeveloped and maintained by Joshua Gross <josh@spandex.io> for SpanDeX.io.\n\nLicense\n-------\nMIT.\n","readmeFilename":"README.md","_id":"serverswap@1.4.5","description":"serverswap ==========","dist":{"shasum":"bd505d654e76f6f1705f84127acd235ec78ebc79","tarball":"https://registry.npmjs.org/serverswap/-/serverswap-1.4.5.tgz","integrity":"sha512-RUaZhzCCoXhwKpPhO6KI3Fa01xAmzDQ6lmy2em15RVFR8H8pJY9wwgU/rQGb85kqTf6M1hpfqczV4uDjOl1mFA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDoXREw5v+887W6p5+HEbwlfI9ceWOGXuitsMrkJda1NQIhAIcGfJlxNG7HuEgdcsg4AEMhn4e2iV+P40Ygt5LgiW5v"}]},"_npmVersion":"1.2.0","_npmUser":{"name":"joshuagross","email":"josh@spandex.io"},"maintainers":[{"name":"joshuagross","email":"josh@spandex.io"}]}},"readme":"serverswap\n==========\n\nServerSwap is a small command-line utility, written in Node.js, that has one job: perform zero-downtime server restarts.\n\nGet it\n------\n`npm install -g serverswap`\n\nCommand-line Usage\n------------------\nStart your server like this:\n\nIf your server is server.js in the current directory: `serverswap node server.js` \n\nYou can also pass command-line arguments to your server: `serverswap node server.js a b c`\n\nYour server does not need to be running on Node.js, but I have only provided a client library for Node.js currently.\n\nServer Usage\n------------\nThe core intuition behind ServerSwap is that servers can communicate with ServerSwap to let it know when everything they need has been initialized, and\nall they need to do is bind to a port.\n\nWhen the ServerSwap instance receives the readyFor message, it will attempt to find an existing server, bring it down, and then send a message back to your new server that it can safely start up.\n\nOld servers are killed unceremoniously by default, but you can also set your server to respond to a `takeDown` message:\n\n```\n// server.js\n// Start with: serverswap server.js\nvar http = require('http')\n  , serverswap = require('../');\n\n// connect to databases\n// ...\n// load some more stuff\n// ...\n\nserverswap.readyFor(':8080', function () {\n  var server = http.createServer(function (req, res) {\n    res.writeHead(200, { 'Content-Type': 'text/plain' });\n    res.end(\"Hello World!\\n\");\n  }).listen(8080);\n\n  console.log('Listening on port 8080');\n\n  serverswap.onTakedown(':8080', function () {\n    // Stop taking new connections on port 80\n    console.log('Took down port 8080');\n    server.close();\n    // Give existing requests 5 seconds to finish processing\n    setTimeout(function () {\n      process.exit(0);\n    }, 5*1000);\n  });\n})\n```\n\nYou can send as many `readyFor` and `onTakedown` messages as you want for a staggered server deploy. `serverswap` will keep running until the older server process exits.\n\nMotivation\n----------\nWhile working on SpanDeX.io I would often need to deploy code to our production servers, which resulted in (at worst) 30 seconds to (at best) 6 seconds of downtime in which users would be disconnected from documents and the server would appear dead to the outside world.\n\nI'm sure I wasn't the first person to think of this, but I had a simple intuition: just don't take down the old server process until the new server process is ready to listen on an HTTP port. Between deploys and server restarts, this result in close to 0 milliseconds of downtime.\n\nCredit\n------\nDeveloped and maintained by Joshua Gross <josh@spandex.io> for SpanDeX.io.\n\nLicense\n-------\nMIT.\n","maintainers":[{"name":"joshuagross","email":"josh@spandex.io"}],"time":{"modified":"2022-06-26T18:10:49.984Z","created":"2013-01-14T04:52:34.352Z","1.0.0":"2013-01-14T04:52:35.070Z","1.0.1":"2013-01-14T06:57:10.650Z","1.1.0":"2013-01-14T07:38:42.168Z","1.1.1":"2013-01-14T19:38:18.822Z","1.1.2":"2013-01-14T20:35:54.914Z","1.1.3":"2013-01-14T20:53:37.406Z","1.1.4":"2013-01-15T08:37:03.360Z","1.1.5":"2013-01-15T23:02:33.712Z","1.1.6":"2013-01-16T07:01:46.430Z","1.1.7":"2013-01-16T07:03:50.597Z","1.1.8":"2013-01-16T07:23:40.635Z","1.1.9":"2013-01-16T07:57:13.411Z","1.1.10":"2013-01-16T08:12:01.125Z","1.1.11":"2013-01-16T08:22:11.609Z","1.1.12":"2013-01-16T08:43:49.391Z","1.1.13":"2013-01-16T22:34:48.264Z","1.1.14":"2013-01-17T20:13:49.551Z","1.1.15":"2013-01-17T21:22:40.335Z","1.1.16":"2013-01-17T21:51:39.809Z","1.1.17":"2013-01-17T21:55:34.280Z","1.1.18":"2013-01-18T01:43:27.018Z","1.1.19":"2013-01-24T02:35:45.471Z","1.1.20":"2013-01-29T20:19:02.537Z","1.1.21":"2013-01-29T20:46:35.733Z","1.1.22":"2013-01-29T21:16:19.341Z","1.1.23":"2013-01-29T23:52:15.652Z","1.1.24":"2013-01-30T02:31:11.151Z","1.3.0":"2013-01-30T04:21:03.626Z","1.3.1":"2013-01-30T05:00:25.324Z","1.4.0":"2013-02-04T17:38:06.245Z","1.4.1":"2013-02-13T05:05:30.737Z","1.4.2":"2013-02-17T22:37:41.669Z","1.4.3":"2013-02-18T02:18:29.291Z","1.4.4":"2013-02-24T08:13:00.266Z","1.4.5":"2013-02-24T09:08:28.769Z"}}