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 🙏

© 2024 – Pkg Stats / Ryan Hefner

reserver

v1.1.2

Published

A tiny dev server that rebuilds your static web app

Downloads

23

Readme

reserver

A tiny dev server that rebuilds your static, single-page app when you refresh your browser.

Why not Grunt/Gulp/etc

  • I don't like writing config files
  • I don't like installing plugins that wrap existing modules (eg gulp-browserify)
  • I don't want live-reload refreshing my browser in the background
  • I don't want temporary build/debug files to hang around in my server /www directory
  • I want compilation errors displayed in the browser
  • I want my CSS compiled from LESS or Stylus and Autoprefixed
  • I want my JavaScript or CoffeeScript browserified
  • I want my app's console.log output to show up in the terminal
  • I want parallel builds in under 100ms

Conventions

Reserver is a built-tool-by-convention. Instead of writing config files, it expects your app to have the following structure:

/html/index.ext -> compiled to /index.html
/js/index.ext   -> compiled to /index.js
/css/index.ext  -> compiled to /index.css

Inside each directory there needs to be a file called index with it's appropriate extension. Based on the extension, reserver will compile the index file as necessary. For example if you have /css/index.less then less will be used to compile your CSS.

Supported extensions are:

index.less   -> compiled with Less CSS
index.styl   -> compiled with Stylus
index.ejs    -> compiled with EJS
index.jade   -> compiled with Jade
index.hb     -> compiled with Handlebars
index.coffee -> compiled with coffeeify
index.js     -> compiled with browserify

Your index.html should include the compiled JS & CSS as follows:

<head>
  <link rel="stylesheet" href="index.css" type="text/css" media="screen" />
  <script type="text/javascript" src="index.js"></script>
</head>

Usage

Install:

$ sudo npm install -g browserify
$ sudo npm install -g reserver

Run reserver on port 8080 looking for html/js/css folders in src and serving static files from www:

$ reserver ./src ./www --port 8080

Open up your browser and visit localhost:8080. Change files in /src, refresh your browser and your app gets re-compiled in the background.

Requirements

The build system requires that any necessary build modules are installed globally or locally to node_modules.

For example if you're using LESS CSS, make sure you've installed the module globally on your machine.

For node to find your global modules, make sure NODE_PATH is set correctly:

$ export NODE_PATH=/usr/local/lib/node_modules

To Do

  • Add support for Type-Script