npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

keep-alive-ping

v1.0.0

Published

Keeps a free-tier website awake by sending automatic requests to it at any interval you set.

Readme

keep-alive-ping

Free hosting sites (Render, Railway, Heroku) put your site to sleep when nobody visits it. This module sends automatic requests to your site so it stays awake.

Install

npm install keep-alive-ping

Two ways to use it

1. Run it directly (no code needed)

npx keep-alive-ping <your-url> <interval-in-milliseconds>

2. Use it inside your own Node app

const keepAlive = require('keep-alive-ping');

const stop = keepAlive('https://mysite.com', 5 * 60 * 1000); // url, interval in ms
// ...your own code here...

// When you want to stop, call stop()
process.on('SIGINT', () => { stop(); process.exit(0); });

stop() is optional. Without it the pings keep going, which is what you want for a server that should always stay awake.

If you cloned this repo

npm install
node index.js <your-url> <interval-in-milliseconds>

How to use

Open a terminal and run:

npx keep-alive-ping <your-url> <interval-in-milliseconds>

Example 1 — ping my site every 5 minutes:

npx keep-alive-ping https://mysite.com 300000

Example 2 — ping my site every 1 minute:

npx keep-alive-ping https://mysite.com 60000

Example 3 — no interval given, it uses 5 minutes:

npx keep-alive-ping https://mysite.com

Time in milliseconds:

| You want | Type this | | --- | --- | | every 10 seconds | 10000 | | every 1 minute | 60000 | | every 5 minutes | 300000 | | every 30 minutes | 1800000 |

What you will see

2026-10-03T16:39:36.240Z 200 https://mysite.com
2026-10-03T16:44:36.301Z 200 https://mysite.com

Every line means one request was sent. 200 means your site replied correctly.

If you see FAIL, the request did not go through. The reason is printed next to it (for example, no internet, or your site took too long to reply).

To stop it

Press Ctrl + C in the terminal.

Testing it on your computer

The test-server folder has a dummy website that logs every request it receives. Use it to check that your module is working.

Terminal 1 — start the dummy site:

node test-server/server.js

You will see it log every request:

Test server on http://localhost:4000
2026-10-03T16:48:39.894Z request received: GET /

Terminal 2 — start the module:

node index.js http://localhost:4000 5000

(If you installed it from npm, type npx keep-alive-ping http://localhost:4000 5000 instead.)

If terminal 1 keeps printing new lines, the module works.

Good to know

  • It sends a simple GET request (the same thing a browser does when it opens a page).
  • If your site needs a login or password, this will not work as it is.
  • If a request takes longer than 10 seconds, it gives up and tries again on the next interval.