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

csstylus

v1.0.0

Published

Compile, Minify and concatenate stylus and css files and serve them as a unique css file

Downloads

5

Readme

csstylus

A node.js package tCompile, Minify and concatenate stylus and css files and serve them as a unique css file.

How does it work ?

First you should create a .json file with the list of your files to be included.

Let's say you want to generate the file final.css. You should then create a file named final.json :

{
        "modules":["file1","file2.styl","file3.css"]
}

File1 and file2 are considered as stylus files and they are read from the stylus path defined bellow. file3 is a css files and it is read from the css directory defined below.

In the node.js part, you have to use csstylus middleware.

app.use( '/csstylus', csstylus.static({
                        styl:__dirname+'/styles/styl',
                        css:__dirname+'/styles/css',
                        json:__dirname+'/styles/json',
                        dest:__dirname+'/styles/dest',
                        files:__dirname+'/styles/files'
                    }) );

Another way to do the same thing is:

app.use( '/csstylus', csstylus.static()
                     .config({
                        styl:__dirname+'/styles/styl',
                        css:__dirname+'/styles/css',
                        json:__dirname+'/styles/json',
                        dest:__dirname+'/styles/dest',
                        files:__dirname+'/styles/files'
                    }) );

The only mandatory parameter is styl. All not given parameter are taken from the same value styl.

The middleware is now mounted to the path /csstylus. In your HTML file you should include this line:

<link href="/csstylus/final.css" rel="stylesheet">

The first time the file is invoked, it is built and stored in the dest directory. The next time it is referenced, it is served directly.

File compression

You can decide whether .css and .styl files are compressed or not, by calling .config method of the middleware:

app.use( '/csstylus', csstylus.static({
                        styl:__dirname+'/styles/styl',
                        css:__dirname+'/styles/css',
                        json:__dirname+'/styles/json',
                        dest:__dirname+'/styles/dest'
                    }).config({minifyCss:true,minifyStyl:false}) ) );

Default values are {minifyCss:false, minifyStyl:true}

What if a file modified?

The final .css file is created on the first time it is invoqued. Modification date is not checked. So, to rebuild it, you should just relaunch node.js.