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

zulu

v0.1.1

Published

Serve up static files piping them through scripts like a boss

Downloads

17

Readme

zulu

Serve up static files piping them through scripts like a boss.

Motivation

Building static webpages, which should be pretty straight forward, has become increasingly complicated with all the tooling that comes with modern web development. Just to get up and running, I usually find myself having three terminal windows open, one for serving static files, one for compiling JavaScript (watchify) and another to compile CSS (usually postcss).

Lately it has become increasingly popular using npm scripts over task runners such as grunt or gulp. So why not put those same scripts to work serving you fresh compiled assets for every request? That is just what zulu does; fire up a static file server piping select routes through your already defined scripts.

~~Installation~~

NOTICE: Still missing thorough testing, not recommended for usage just yet.

$ npm install --save-dev zulu

Usage

Zulu is best incorporated into your package.json under scripts as so:

{
  "name": "my-module",
  "version": "1.0.0",
  "scripts": {
    "build": "npm run build:js & npm run build:css",
    "build:js": "browserify src/main.js -t [ babelify --presets [ es2015 ]]",
    "build:css": "postcss src/main.css -u postcss-import -u autoprefixer",
    "start": "zulu -r [ public ] -r [ main.js -s build:js ] -r [ main.css -s build:css ]"
  }
}

Running npm start will serve all files in the folder public (as is) as well as pipe requests for /main.js through browserify and requests for /main.css through postcss giving you compiled assets on demand. Though zulu is not restricted to only npm scripts, you can run any command when piping requests.

Examples

# Just serve static files in current dir
$ zulu
# Bundle, minify and gzip JavaScript
$ zulu '**/*.js' -s 'browserify - -t [ babaelify --presets [ es2015 ]]' -s uglifyjs -s 'gzip --to-stdout'
# Compile SASS source files to CSS
$ zulu '**/*.scss' -s 'sassc --stdin --sourcemap'
# Render markdown files to HTML
$ zulu '**/*.md' -s 'multimarkdown --full'

Options

  • --port, -p Server port
  • --route, r Create a route for path (relative to parent path)
  • --script, -s Pipe associated route through script (zero or more per route)
  • --help, -h Show help information

TODO

  • [ ] Handle multiple paths per route
  • [ ] Speed (constant running processes?)
  • [ ] Support POST
  • [ ] Add caching mechanism