Severity
Low
Short Description
This package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Packages
View packages with this alert.Suggestion
In many cases minified code is harmless, however minified code can be used to hide a supply chain attack. Consider not shipping minified code on npm.
This alert indicates that the package contains minified code. While minified code may be harmless in some cases, such as when it is part of a packaged library, it is generally recommended that packages published on npm do not include minified code.
It is best left to package consumers to minify their own code. This ensures that the dependency tree of codebases using the package can be analyzed more accurately, which might lead to better tree-shaking performance.
While minifying reduces the file size and improves performance, it also makes the code harder to read and review.
Including minified code in packages can be problematic because:
Here's an example of minified code that may have been minified using a bundler or minification tool. It embeds CSS dynamically, which makes it less transparent and more difficult to review.
This alert currently only applies to the npm ecosystem. Socket analyzes the structure and content of the code file to detect minified code, which usually has a high density of characters with minimal whitespace or line breaks, short variable names or single-character function names, and/or compressed or embedded assets.