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

ho

v1.2.0

Published

Ho ho ho the jolly css/less system

Downloads

47

Readme

Ho ho ho

The jolly css/less system

Getting started

npm i ho

You can install as a global if you like, either way you’ll end up with the ho executable which can be used to perform various stylesheet related festive (or not) shenanigans.

Compiling

Just want to compile your less, no problem, just give it entry and output paths

ho compile -e src/main.less -o dist/styles.css

Ho will output a few bits and bobs to the console while it’s working so no streaming just yet (it’s getting there).

Ho has a load of built-in help for more options—for compiles just specify parameters for less to use

ho compile -h

Watching

Watching is pretty handy, it’d be useful if there was a shorthand for it, oh wait a sec...

ho watch -w 'src/**/*.less' -e src/main.less -o dist/styles.css

Watch will fire a compile on file change event so it accepts the same parameters as compile plus the glob to watch for. If your shell auto-expands globs (which is likely) then pass it through as a string, ho will expand it.

Help

Ho tries to be self documenting, but if you’re really stuck then open an issue

ho <command> --help

Transforms and configuration

Specify a custom set of transforms and their configuration using an external file and the -c flag

ho <command> -c .horc

You can specify a custom file if you like but using the package.json will work just as well, just add a ho key for your configuration

ho <command> -c package.json
...,
"ho": {
  "autoprefixer-transform": {
    "browsers": [
      "last 2 versions"
    ]
  }
},
...

The configuration block should specify a list of modules as keys to include in the transform pipeline, each module will be instantiated using the values in the config as their constructor params. So, the previous example will work out something like this in code:

let Transform = require( 'autoprefixer-transform' )
let transform = new Transform({
  browsers: [
    'last 2 versions'
  ]
})

This transform will then get appended to the transform pipeline and will end up outputted to a write stream pointed wherever you specified with -o.

Custom transforms

There are a few caveats to creating custom transforms

  • They should extend Stream.Transform or a comparable stream abstraction
  • Use the module name as the key in the configuration
  • The module declaration should specify a constructor function which will be invoked with the options set out in the configuration file

Thats about it, eventually we’ll let Ho output to a stdout which would make this sort of thing more robust but for now if you want something else just wrap it in a transform stream and you’re good to go (example)