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

quickie

v0.0.1

Published

A tiny framework for serving statics sites with node.

Downloads

4

Readme

Quickie

A tiny framework for serving statics sites with node. Quickie serves up basic html pages and static assets. It also supports custom routes and render methods.

Basic Usage

Get it from NPM. In your project's directory, simply run:

$ npm install quickie
Folder Structure

Quicky looks at your templates folder automatically configures routes to those pages. It also supplies a safe place for you to keep your static assets (css, js, images, anything you'll be attempting to access from the front-end).

If you're not planning on doing any customization, Quickie only expects that you keep your html files in a "pages" folder and your static assets in a folder called "public". Your project should probably look something like this:

myProject
 - node_modules
 - pages
 |-- index.html
 |-- pizza.html
 - public
 |-- css
   |-- whatever.css
 |-- images
   |-- whatever.png
 - app.js

This would mean you could access index.html from http://localhost:3000/ and pizza.html from http://localhost:3000/pizza. Pretty straightforward, right?

One line in app.js!
var quickie = require('quickie').site(__dirname).listen();

Ok, so you could technically break it out into three lines for readability.

var quickie = require('quickie');
var site = quickie.site(__dirname);
site.listen();
Any port in a storm

You can also pass any port number into the listen method (by default, it's 3000);

var quickie = require('quickie').site(__dirname).listen(1337);
The __dirname is important

You must always pass __dirname into quickie. If you'd like to include it with other options in an object, do this:

var quickie = require('quickie').site({
  dirname: __dirname,
  // etc.
}.listen();

Available Options

assets (string)

Use this option if your you'd like your static assets folder to be called something other than "public".

var quickie = require('quickie').site({ dirname: __dirname, assets: 'static/', }).listen();

templates (string)

Use this option if your you'd like your templates to live in a folder called something other than "pages".

var quickie = require('quickie').site({ dirname: __dirname, templates: 'views/', }).listen();

render (function)

Use this option if you're trying to get fancy with a custom template rendering engine. I like to use nunjucks with mine:

var nunjucks = require('nunjucks');

var quickie = require('quickie').site({
  dirname: __dirname,
  assets: 'static/',
  tempaltes: 'views/',
  render: function(markup, data) {
    return nunjucks.renderString(markup, data);
  }
}).listen();

You might be asking yourself where that data is coming from. See the next section for details on passing data through to templates using custom routes.

extension (string)

Use this option if your templates have a file extension other than '.html'. In the previous example, we set up nunjucks as our renderer. Nunjucks uses the '.html' file extension so we didn't need to specify an alternative file extension. If we wanted to use Jade, we could have written it like so:

var jade = require('jade');

var quickie = require('quickie').site({
  dirname: __dirname,
  extension: '.jade',
  render: function(markup, data) {
    return jade.render(markup, data);
  }
}).listen();

Adding Routes and passing data

You can add custom routes to your Quickie site before calling the listen method.

var nunjucks = require('nunjucks');

var site = require('quickie').site({
  dirname: __dirname,
  assets: 'static/',
  tempaltes: 'views/',
  render: function(markup, data) {
    return nunjucks.renderString(markup, data);
  }
});

// Add your routes before calling listen.
site.addRoute('/special', function(req, res){
  // Do some other stuff before rendering the page, like make an API call or whatever.
  return quickie.sendPage(req, res, 'index', { fancy: 'data' });
});

site.listen();
sendpage(req, res, pageName, [data]);

That sendPage method takes req, res, pageName, and data. The pageName should be a string and '.html' will automatically be appended to it unless you have specified otherwise using the extension option.