Auto-Update
IO automatically keeps itself up to date via npm. Every time the daemon starts, it checks for a newer version and installs it — no configuration or manual intervention required.
How It Works
- Check — On startup, the daemon runs
npm view heyio versionto fetch the latest published version from the npm registry - Compare — The result is compared against the version in the running
package.jsonusing semver - Install — If a newer version exists,
npm install -g heyio@latestis executed automatically - Re-exec — After a successful install, the daemon spawns a new process with the updated code and exits the old one so the new version takes over immediately
The entire flow happens before the daemon begins normal operation, so you are always running the latest release.
No Configuration Needed
Auto-update is always on. There are no flags to toggle or intervals to set — the check runs once at startup and either updates or continues with the current version.
If the npm registry is unreachable or the install fails for any reason, the daemon logs a warning and continues running the current version normally.
Manual Update
You can update at any time by running:
npm install -g heyio@latestThen restart the daemon to pick up the new version.
How Re-exec Works
When an update is installed, the daemon re-launches itself so the new code is loaded without requiring a separate restart:
- A new detached child process is spawned using the same Node executable and arguments
- The environment variable
IO_RESTARTED=1is set on the child so it can detect a post-update restart - The child is
unref()'d so it is not tied to the parent - The original process exits with code 0
This means the transition is seamless — the new version picks up exactly where the old one would have started.