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

bruce-server

v1.2.0

Published

A simple server with easy configuration that supports static files and APIs

Downloads

12

Readme

Bruce Server

A very simple to use and somewhat configurable HTTP(S) server (named after me) in node.js that can be run on the command line or require()d, with the ability to easily build an HTTP(S) API on top of it.

Getting started

This program can be installed with npm install bruce-server. It can be require()d or used as a command line program. Sample code:

const httpServer = require("bruce-server");
httpServer.startHTTPServer({
	files: {
		index: "index.html",
		notFound: "404.html",
		error: "500.html",
		defext: ".html",
		root: process.cwd(),
	},
	crypto: {
		key: path.join(process.env.HOME, "key.pem"),
		cert: path.join(process.env.HOME, "cert.pem")
	},
	porthttp: 8080,
	porthttps: 8443,
	mode: "httpsredir",
	api: undefined
});

It is mandatory to pass a configuration object as the first parameter. The sample code includes a reasonable default, but you may wish to modify it. See the docs for more details.

To run on the command line, type bruce-server. If it is used that way, it will default to a configuration of

{
	files: {
		index: "index.html",
		notFound: "404.html",
		error: "500.html",
		defext: ".html",
		root: process.cwd()
	},
	crypto: {
		key: path.join(process.env.HOME, "key.pem"),
		cert: path.join(process.env.HOME, "cert.pem")
	},
	porthttp: 8080,
	porthttps: 8443,
	mode: "httpsredir",
	api: undefined
}

and will then try to read from a JSON file at ~/.bruceserverrc, then ./.bruceserverrc. If a command line argument is passed, the server will first attempt to parse it as configuration JSON, then as a location of a file containing configuration JSON. Invalid configuration is ignored. When launched this way, the server produces a log file at ~/.bruceserverlog.

Contributing

The Git repository is at https://gitlab.com/0100001001000010/bruce-server. The issue tracker is at https://gitlab.com/0100001001000010/bruce-server/issues. All contributions are welcome. Please check out a new branch with a memorable name, such as your username, to make your contributions on.

The master branch contains the releases. You probably should not base your branch on this one.

The development branch is where most development takes place. You probably should base your branch on this one.

Dependencies

node.js (Tested on 8.11.1) - JavaScript runtime

fs 0.0.1-security - read files, write the log file

http 0.0.0 - serve stuff over HTTP

https ^1.0.0 - serve stuff over HTTPS

mime ^2.3.1 - determine the MIME type of files for the HTTP header

path ^0.12.7 - deal with file paths

url ^0.11.0 - parse URLs

nodemon ^1.18.3 (devDependencies only) - restart when source code changes

Licensing

This code is licensed under the GNU GPL version 3. You should have received a copy of the license with this program.

Disclaimer

The license says it, but I'll say it again. This program comes with no warranty. This means that you use it at your own risk and I am not responsible for anything that happens as a result of using this program.

This is something I put together in my free time for fun. I have done my best to make it stable and bug free, but I do not guarantee that it is. Before using my program for something important, please test it.