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

fwhp

v0.0.9

Published

Grant temp firewall access (or run other actions locally) through web authentication

Readme

fwhp

Grant temp firewall access (or run other actions locally) through web authentication

This might come in handy when you need to connect to your firewall-protected server from an unusual IP address. For example, if you're on vacation.

How it works

  • You tell fwhp what script/command to execute upon successful authentication (e.g. add some firewall rules to temporarily grant access to that IP address).
  • fwhp starts a native node.js HTTPS server and waits for a correct password.
  • When it gets a correct password it executes your command as follows: /your/script allow <IP> [<optional arguments you configured>]
  • After the time you configured it runs the same script as follows: /your/script deny <IP> [<optional arguments you configured>]

Config

If you want - you can have several passwords that trigger different actions. Here's a sample config file:

module.exports = {
	general: {
		ip: '0.0.0.0',						// IP that FWHP should listen on
		port: 1000,								// TCP port to bind to
		time: 18000,							// default time in seconds after which the 'deny' action is called
		ssl: '/etc/fwhp/ssl',			// the folder with SSL cert.pem and key.pem files
		log: '/var/log/fwhp.log'
	},
	passwords: {
		// This section defines the valid passwords and the actions to take upon successful authentification with that password
		'password1': {
			cmd: '/etc/fwhp/cmd/iptables.js',	// the local script to run upon successful authentication
			time: 18000,											// redefine the default time
			arg: 'trusted'										// An optional argument that may be passed to that CMD in addition to the standard ones (e.g.: ipset set name, port number)
		},
		'password2': {
			cmd: '/etc/fwhp/cmd/iptables.js',
			arg: '2222'
		}
	}
};

Scripts

Sample scripts are provided with the app (see the config/cmd folder). Here's an example of what your script may look like:

var action, exec, ip, set, _ref;
exec = require('child_process').exec;

// parse the arguments
_ref = process.argv.slice(2), action = _ref[0], ip = _ref[1], set = _ref[2];

// make something useful
switch (action) {
	case 'allow':
		exec("ipset add " + set + " " + ip);
		break;
	case 'deny':
		exec("ipset del " + set + " " + ip);
		break;
	default:
		console.log("Wrong action provided");
}

Usage:

sudo fwhp-start /etc/fwhp/config.js

Installation

You will need a node.js and npm packed manager to install it:

sudo npm install -g fwhp
sudo fwhp-init-config

Running fwhp-init-config is optional. It will:

  • install the sample config file
  • install sample script files
  • optionally generate you a self-signed SSL certificate (needed for running HTTPS server)

If you don't have node.js installed on your system, here's how to do it (Ubuntu/Debian)

sudo apt-get install nodejs npm