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 🙏

© 2025 – Pkg Stats / Ryan Hefner

rainier-beer

v1.0.1

Published

A simplified express style router.

Readme

Rainier-Beer Http Framework

A simplified express style router

How to use the rainier-beer framework

How to Install

npm install rainier-beer

In order to use rainier-beer you must require it in:

const rainierBeer = require('rainier-beer');

In order to create a server you must also require-in http:

const http = require('http');

How to use Router

You can create a Router by making a new constructor equal to a variable

 const practiceRouter = new rainierBeer();

After that you must create a server as you normally would by using http.createServer:

http.createServer(practiceRouter.route()).listen(3000, () => console.log('server up'));

Now you can begin to make easy, one line GET and POST requests.

POST

practiceRouter.post('/tiger', '220', 'text/plain', 'Tiger Tiger in the Night');

Parameters:

There are 5 parameters for calling the .post() function

  • routeName: is the url path extension (ex/ '/' or '/anything')
  • statusCode: is the status you want to define (ex/ 200, 404, 300);
  • Content-Type: is the type of response you want (ex/ plain/text, application/json)
  • write: is what is written to the response (ex/ "Hello Rainier Beer!")

With the post request there is no option for default values but the parameters are extremely customizable.

If you want to print data that is being pushed through then you must put the write parameter to equal chunk

practiceRouter.post('/duck', '270', 'text/plain', 'chunk');

If you want to write an individualized response then substitute chunk for any string of your choosing.

practiceRouter.post('/tiger', '220', 'text/plain', 'Anything except for "chunk"');

GET

practiceRouter.get = function(routeName, statusCode, contentType, write, cb)

Parameters:

There are 5 parameters for calling the .get() function

  • routeName: is the url path extension (ex/ '/' or '/anything')
  • statusCode: is the status you want to define (ex/ 200, 404, 300);
  • Content-Type: is the type of response you want (ex/ plain/text, application/json)
  • write: is what is written to the response (ex/ "Hello Rainier Beer!")

Default Values:

While indicating your own routeName is mandatory, inherit to the GET requests using this Router are a couple of default values should you choose not to input your own parameters when calling the .get() function.

  • statusCode: 200
  • Content-Type: plain/text
  • write: Received GET

If you want to use the default values for a get request then an example is as follows:

practiceRouter.get('/cat');

If you want to customize your own you can input your own values for the parameters.

practiceRouter.get('/moose', 210, 'text/plain', 'Hello Kat');

DELETE/PUT/PATCH

While these are a;; Unlike GET and POST, the remaining three REST verbs have a less stream-lined but can more easily be modified.

Below is an example of how to use DELETE.

practiceRouter.delete('/delete', (req, res) => {
  res.writeHead(200, { 'Content-Type': 'text/plain' });
  res.write('so much delete');
  res.end();
});

Note: PUT and PATCH each have very similar syntax to one another thus only an example of PUT can be seen below.

practiceRouter.put('/put', (req, res) => {
  req.on('data', (chunk) => {
    res.writeHead(200, { 'Content-Type': 'text/plain' });
    res.write(chunk);
    res.end();
  });
});

Sample Use:

If you want to view sample code of our npm being used then look at our github into the server.js file within the lib directories.

https://github.com/kbeame/rainier-beer/blob/master/lib/server.js

Dependencies:

  • Gulp was used for task management (gulp-eslint, gulp-mocha)
  • Mocha Chai (with chai-http) were used for testing

Authors:

Katherine Beame and Benjamin Nolan

Resources Used:

This framework is heavily based off of in-class demonstrations in Javascript CodeFellows 401-d7.

The authors also referred to the npm package sludgie-trucker-coffee for inspiration.