
Company News
AWS Security Hub Adds Socket for Supply Chain Security
Socket is now in the AWS Security Hub Extended plan. Adopt it through AWS, apply committed spend, and block malicious open source packages.
console.macro
Advanced tools
简化了一些console的常用方法,并在process.env.NODE_ENV等于production的时候移除这些方法。
默认是log方法,还支持error, warn, info, table, time, timeEnd。
npm install --save-dev babel-plugin-macros console.macro
yarn add babel-plugin-macros console.macro --dev
// babel.config.js add babel-plugin-macros
plugins = ['babel-plugin-macros'];
import log, { error, info } from 'console.macro';
const logMsg = 'log message';
log('This is a', logMsg);
error('this is a error');
info('this is a info');
// process.env.NODE_ENV !== 'production'
const logMsg = 'log message';
console.log('This is a', logMsg);
console.error('this is a error');
console.info('this is a info');
// process.env.NODE_ENV === 'production'
// remove all support method
const logMsg = 'log message';
FAQs
A Babel macro that removes console prints in production
We found that console.macro 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.

Company News
Socket is now in the AWS Security Hub Extended plan. Adopt it through AWS, apply committed spend, and block malicious open source packages.

Research
/Security News
Popular npm packages keyv and cacheable compromised.

Security News
A misconfiguration gave three Anthropic models internet access, and one, believing it was in a simulation, shipped a credential-stealing package to PyPI.