Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
RCSSmin is a CSS minifier.
The minifier is based on the semantics of the YUI compressor
, which itself
is based on the rule list by Isaac Schlueter
.
This module is a re-implementation aiming for speed instead of maximum compression, so it can be used at runtime (rather than during a preprocessing step). RCSSmin does syntactical compression only (removing spaces, comments and possibly semicolons). It does not provide semantic compression (like removing empty blocks, collapsing redundant properties etc). It does, however, support various CSS hacks (by keeping them working as intended).
Here's a feature list:
Strings are kept, except that escaped newlines are stripped
Space/Comments before the very end or before various characters are
stripped: :{});=>],!
(The colon (:
) is a special case, a single
space is kept if it's outside a ruleset.)
Space/Comments at the very beginning or after various characters are
stripped: {}(=:>[,!
Optional space after unicode escapes is kept, resp. replaced by a simple space
whitespaces inside url()
definitions are stripped, except if it's a
quoted non-base64 data url
The nesting selector (&
) is recognized
Comments starting with an exclamation mark (!
) can be kept optionally.
All other comments and/or whitespace characters are replaced by a single space.
Multiple consecutive semicolons are reduced to one
The last semicolon within a ruleset is stripped
CSS Hacks supported:
>/**/
)/*\*/.../**/
):first-line
and the following comma or curly brace a space is
inserted. (apparently it's needed for IE6):first-letter
rcssmin.c is a reimplementation of rcssmin.py in C and improves runtime up to factor 100 or so (depending on the input). docs/BENCHMARKS in the source distribution contains the details.
Supported python versions are 2.7 and 3.6+.
.. _YUI compressor: https://github.com/yui/yuicompressor/
.. _the rule list by Isaac Schlueter: https://github.com/isaacs/cssmin/
Copyright and License
Copyright 2011 - 2024
André Malo or his licensors, as applicable.
The whole package (except for the files in the bench/ directory) is
distributed under the Apache License Version 2.0. You'll find a copy in the
root directory of the distribution or online at:
<http://www.apache.org/licenses/LICENSE-2.0>.
Bugs
~~~~
No bugs, of course. ;-)
But if you've found one or have an idea how to improve rcssmin, feel free
to send a pull request on `github <https://github.com/ndparker/rcssmin>`_
or send a mail to <rcssmin-bugs@perlig.de>.
Author Information
~~~~~~~~~~~~~~~~~~
André "nd" Malo <nd perlig.de>
GPG: 0x029C942244325167
If God intended people to be naked, they would be born that way.
-- Oscar Wilde
.. vim:tw=72 syntax=rest
FAQs
CSS Minifier
We found that rcssmin demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.