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

@ndcode/clean-css

v4.2.2

Published

A well-tested CSS minifier (added NDCODE hooks)

Downloads

23

Readme

CSS minifier based on existing NPM package (added NDCODE hooks)

An NDCODE project.

Overview

This is a minor modification to the NPM clean-css package version 4.2.1. For the complete usage information, please see the original documentation at: https://www.npmjs.com/package/clean-css. We gratefully acknowledge the authors for their MIT-licensing the package.

Modifications

Suppose this package is imported as let CleanCSS = require('@ndcode/clean-css') and then instantiated by let clean_css = new CleanCSS(...), then usually minification is done by calling clean_css.minify(input, maybeSourceMap, maybeCallback).

We define a similar function for minifying CSS embedded in other source code,

clean_css.minifyEmbedded(
  input,
  embeddedStart,
  maybeSourceMap,
  maybeCallback
)

This makes parsing start at the specified character position embeddedStart in the input string, which should be just after an opening { character. CSS is parsed while counting the nesting level of braces, and parsing stops when an unmatched } is encountered. The embedded CSS is then minified as per usual.

Suppose the minifyEmbedded() function returns the object result, then the minified CSS is normally accessed as result.styles. We define a new field result.embeddedEnd which contains the character position of the } that stopped the parsing. If no unmatched } is found, -1 is returned instead.

Note that passing embeddedStart == -1 makes minifyEmbedded() behave the same as minify(), and that embeddedEnd == -1 is returned by both minify() and minifyEmbedded() in the case that no final } was found and/or sought.

The embedded-CSS interface is used by the jst (JavaScript Templates) package.

To be implemented

In the future we may also add separate APIs for parsing and rendering the CSS. This would have been handy for the current usage, since the jst package works by parsing, transforming, and then rendering the source code tree, but for now it was simpler just to minify the CSS completely to a string during parsing.

GIT repository

The development version can be cloned, downloaded, or browsed with gitweb at: https://git.ndcode.org/public/clean-css.git

License

All of our NPM packages are MIT licensed, please see LICENSE in the repository.

Contributions

Feedback on NDCODE packages and/or code contributions are gratefully welcomed.

Contact: Nick Downing [email protected]