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

@tiny-css/compiler

v0.1.1

Published

The compiler for compiling & reducing the bundle size of tiny-css

Downloads

3

Readme

Tiny CSS Compiler

The compiler for tiny-css. It optimizes & injects styles relative to classnames defined in the provided HTML files & only inserts them and not a byte more than them.

Features

  • Lowers the weight of css bundle
  • Really good for SSR(Server Side Render) as it would output only css style declaration that are relative to classnames defined in the static HTML files
  • Removes unimportant style declarations from the output.css file. Very efficient for heavy css frameworks like bootstrap or materialize as it only keeps the necessary style declarations
  • It not only works with Tiny-CSS but also with all kinds of css frameworks if the stylesheet defined classes are passed as an JSON files to --classes option and stylesheet with --input option

Installation

With npm

npm install @tiny-css/compiler --save-dev

With yarn

yarn add @tiny-css/compiler --dev

CLI-Options

| Options | alias | What it does | Default | | ------------- | ----- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------- | | input | i | CSS Input file which will be used to retrieve style objects. This can be a fs path or a cdm link | [required] | | cdn-version | c |The version of the cdn input file. Important if --disable-cache option is disabled & files are cached. This is used to determine the cache file location. Not required if using fs path | 0.0.1 | | output | o | The file where css declarations will be outputted | ${cwd}/tiny.output.css | | debug | d | Outputs verbose information about the currently running process | false | | cwd | N/A | Custom current working directory | process.cwd() | | ignore | N/A | An array glob pattern to ignore the path for file searching | ./node_modules/**/* | | disable-cache | N/A | Disable caching stylesheets | false |

Example

$ tiny-css ./**/*.html --input ./tiny.css

More examples can be found here

Usage

If using a CDN link always a pass a version of that css file defined in the URL to the cli -c OR --cdn-version option.

Example:

$ tiny-css ./**/*.html --input https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css --cdn-version 4.5.2

Ignoring patters

An --ignore argument option can be passed to the cli to ignore any file/pattern

Example

$ tiny-css ./**/*.html --input ./tiny.css --ignore ./test/** ./node_modules/**

Contributing

Follow the Contribution guidelines

Tests

npm install
npm test

LICENSE

MIT

Social handlers:

Join the Discussion in Discord