Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
babel-plugin-transform-remove-console
Advanced tools
The babel-plugin-transform-remove-console package is a Babel plugin that removes all console.* calls from your JavaScript code. This is particularly useful for production builds where you want to clean up debugging statements.
Remove all console statements
This feature removes all console statements such as console.log, console.error, etc., from the code. After applying the plugin, the resulting code will not contain any console statements.
const example = () => {
console.log('This will be removed');
console.error('This will also be removed');
return 'Hello, World!';
};
This package removes all debugger statements from your code. It is similar to babel-plugin-transform-remove-console but focuses on removing debugger statements instead of console statements.
This package removes dead code from your JavaScript files. While it does not specifically target console statements, it can remove code that is never executed, which may include some console statements.
This plugin removes all console.*
calls.
In
console.log("foo");
console.error("bar");
Out
npm install babel-plugin-transform-remove-console --save-dev
.babelrc
(Recommended).babelrc
// without options
{
"plugins": ["transform-remove-console"]
}
// with options
{
"plugins": [ ["transform-remove-console", { "exclude": [ "error", "warn"] }] ]
}
babel --plugins transform-remove-console script.js
require("@babel/core").transform("code", {
plugins: ["transform-remove-console"]
});
exclude
- An array of console methods to exclude from removal.FAQs
Remove all console.* calls.
We found that babel-plugin-transform-remove-console demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 5 open source maintainers 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 uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.