Research
Security News
Malicious npm Package Typosquats react-login-page to Deploy Keylogger
Socket researchers unpack a typosquatting package with malicious code that logs keystrokes and exfiltrates sensitive data to a remote server.
@parcel/optimizer-htmlnano
Advanced tools
Package description
@parcel/optimizer-htmlnano is a plugin for the Parcel bundler that optimizes HTML files using htmlnano. It helps in reducing the size of HTML files by minifying and compressing them, which can lead to faster load times and improved performance.
Minification
This feature minifies HTML files by removing unnecessary whitespace, comments, and other redundant elements. The code sample shows how to include the @parcel/optimizer-htmlnano plugin in a Parcel configuration file.
module.exports = {
plugins: [
'@parcel/optimizer-htmlnano'
]
};
Compression
This feature compresses HTML files by collapsing whitespace and minifying inline CSS and JavaScript. The code sample demonstrates how to configure htmlnano options within a Parcel configuration file.
module.exports = {
plugins: [
'@parcel/optimizer-htmlnano'
],
htmlnano: {
collapseWhitespace: 'conservative',
minifyCSS: true,
minifyJS: true
}
};
Removing Redundant Attributes
This feature removes redundant attributes from HTML tags, such as type="text/javascript" from script tags. The code sample shows how to enable this option in the htmlnano configuration.
module.exports = {
plugins: [
'@parcel/optimizer-htmlnano'
],
htmlnano: {
removeRedundantAttributes: true
}
};
html-minifier is a highly configurable HTML minifier that can be used to reduce the size of HTML files. It offers a wide range of options for minification, including removing comments, collapsing whitespace, and minifying inline CSS and JavaScript. Compared to @parcel/optimizer-htmlnano, html-minifier is a standalone tool that can be used outside of the Parcel ecosystem.
html-webpack-plugin is a plugin for Webpack that simplifies the creation of HTML files to serve your bundles. It can also minify HTML files using the html-minifier-terser library. While it provides similar HTML optimization features, it is designed to work within the Webpack ecosystem rather than Parcel.
gulp-htmlmin is a Gulp plugin that uses html-minifier to minify HTML files. It is suitable for projects that use Gulp as their build system. Like @parcel/optimizer-htmlnano, it offers various options for HTML minification, but it is tailored for use with Gulp rather than Parcel.
FAQs
Unknown package
We found that @parcel/optimizer-htmlnano 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.
Research
Security News
Socket researchers unpack a typosquatting package with malicious code that logs keystrokes and exfiltrates sensitive data to a remote server.
Security News
The JavaScript community has launched the e18e initiative to improve ecosystem performance by cleaning up dependency trees, speeding up critical parts of the ecosystem, and documenting lighter alternatives to established tools.
Product
Socket now supports four distinct alert actions instead of the previous two, and alert triaging allows users to override the actions taken for all individual alerts.