New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

css-razor

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

css-razor

Remove unused selectors from CSS efficiently

  • 1.1.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
7
decreased by-41.67%
Maintainers
1
Weekly downloads
 
Created
Source

css-razor

css-razor removes unused selectors. It accomplishes a similar task as uncss, but rather than loading a webpage with phantomjs and using document.querySelector to detect selector usage, css-razor loads the static HTML (easily generated by react) and parses it with cheeriojs to remove unused selectors.

  • Helps trim down your CSS to the essentials
  • Built for speed
  • Supports multiple files
  • Supports raw input

Getting Started

npm install --save-dev css-razor

You can then use the cli

css-razor src/index.css src/index.html > index.smaller.css

Or you can use the js api

const cssRazor = require('css-razor').default

cssRazor({
  htmlFiles: ['test/input/index.html'],
  cssFiles: ['test/input/index.css'],
}, function(err, data) {
  console.log(data.css)
})

React Example

Coming soon!

Todo

  • react example
  • tests for raw and multi file
  • test for postcss plugin usage

Keywords

FAQs

Package last updated on 21 Feb 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc