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

enhance-css

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

enhance-css

A well-tested CSS enhancer (Base64, assets hosts, cache boosters, etc)

  • 0.5.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
56
decreased by-58.21%
Maintainers
1
Weekly downloads
 
Created
Source

build status

What is enhance-css?

Enhance-css is a node.js library for enhancing CSS with:

  • external files stamps to boost chaching (either timestamps or MD5 hashes);
  • image embedding to Base64 (to reduce number of requests);
  • spawning assets into multiple asset hosts (to paralelize requests);

There is also an option to create non-embedded version suited well for older browsers (IE 7 and below).

Usage

What are the requirements?

node 0.6.0+ on *nix (fully tested on OS X 10.6+ and CentOS 5.x)
node 0.8.0+ on Windows

How to install enhance-css?

npm install enhance-css

How to use enhance-css?

Most likely you are going to pass multiple CSS files into it and specify root directory and output file, e.g.

cat path/to/first.css path/to/second.css path/to/third.css | enhancecss -o bundled.css --root ./public/

Root ('--root') parameter is required to properly locate images referenced in css files.

To embed images in Base64 just add embed argument to image url, e.g.

a { background: url(/images/arrow.png?embed) 0 0 no-repeat; }

No embed version

In case you also need to support older browser, just add --noembedversion parameter, e.g.

cat path/to/first.css path/to/second.css path/to/third.css | enhancecss -o bundled.css --root ./public/ --noembedversion

which will result in two output files: bundled.css and bundled-noembed.css.

Asset hosts

To use one or more asset hosts, just specify --assetshosts parameter, e.g.

cat path/to/first.css path/to/second.css path/to/third.css | enhancecss -o bundled.css --root ./public/ --assethosts assets[0,1].example.com

which will result in all not-embedded image urls bound to either assets0.example.com or assets1.example.com.

License

Enhance-css is released under the MIT license.

Keywords

FAQs

Package last updated on 05 Sep 2012

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