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.
postcss-csso
Advanced tools
PostCSS plugin to minify CSS using CSSO (a CSS minifier with structural optimizations).
Under the hood, the plugin converts PostCSS
AST into CSSO
's AST, optimises it and converts back. The plugin uses PostCSS
's input AST nodes (or their clones) on back convertation, so the shape of the original PostCSS
's nodes is preserved after the compression in most cases (e.g. properties added by other plugins aren't lost). This approach makes it possible to achieve great performance and correct source maps generation.
The performance of postcss-csso
is approximately the same as CSSO
has itself (see CSSO
numbers in minifiers comparison table).
If you have any difficulties with the output of this plugin, please use the CSSO tracker.
npm install postcss-csso
import postcss from 'postcss';
import csso from 'postcss-csso';
// CommonJS:
// const csso = require('postcss-csso');
postcss([
csso
])
.process('.a { color: #FF0000; } .b { color: rgba(255, 0, 0, 1) }')
.then((result) => {
console.log(result.css);
// .a,.b{color:red}
});
Plugin takes the same options as compress()
method of CSSO with no exception.
postcss([
csso({ restructure: false })
])
.process('.a { color: #FF0000; } .b { color: rgba(255, 0, 0, 1) }')
.then((result) => {
console.log(result.css);
// .a{color:red}.b{color:red}
});
Using in postcss.config.js
:
import csso from 'postcss-csso';
export const plugins = [
csso({
restructure: false
})
];
MIT
6.0.1 (August 11, 2022)
csso
to 5.0.5
which fixes various bugsFAQs
PostCSS plugin to minify CSS using CSSO
The npm package postcss-csso receives a total of 28,251 weekly downloads. As such, postcss-csso popularity was classified as popular.
We found that postcss-csso demonstrated a not healthy version release cadence and project activity because the last version was released 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.