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

cssi

v0.5.7

Published

CSS Selector Scene Investigation. Analyses a git codebase for unused CSS selectors against a given CSS files set

Downloads

39

Readme

cssi

cssi: CSS Selector Scene Investigation. Analyses a git codebase for unused CSS selectors

Getting Started

Install the module with: npm -g install cssi

https://www.npmjs.org/package/cssi

Documentation

cssi
Usage: cssi --css bla.css --repo /path/to/repo [options]

--css:     file | dir | url - css to be parsed
--repo:    /full/path/to/local/repo - local repo where git-grep will search for css
--reverse: finds not the last, but the first commit where the selector was changed
--exclude: "string" or ["array", "of", "strings"] - exclude selectors that contains these strings, to avoid known false positives like icon fonts
--tpl:     "*.ext" - glob of files that should be checked for selectors. Default = "'*.tmpl' '*.inc' '*.js'"
--debug:   shows extra debug information
--out:     filename.html - different report filename. Default is a normalized version of css_path-filename.html
--link:    "https://github.com/bitbonsai/cssi/commit/{sha}" - link to web git show. Can be any valid URL, {sha} is replaced with commit hash
--config:  file.json - load or replace arguments from config file (must be valid json)

Examples

  1. cssi --css css/sample_gen_profile.css --repo /Users/local_repo/ --exclude bicon
  2. cssi --css css/ --repo /Users/local_repo/
  3. cssi --css css/ --repo /Users/local_repo/ --tpl "'*.html' '*.php'" --out myreportname.html --reverse
  4. cssi --css css/ --repo /Users/local_repo/ --config filename.json
  5. cssi --css http://example.com/site.css --repo /Users/local_repo/ --debug

Contributing

In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using Grunt.

Release History

  • 0.5.x - --exclude now accepts string or array of strings to ignore
  • 0.4.x - Added counter and report for original_selectors
  • 0.3.x - Added --link, js sort to table, selector count
  • 0.2.x - Added option to load config file
  • 0.1.x - BrazilJS 2014 version

License

Copyright (c) 2014 Mauricio Wolff
Licensed under the MIT license.