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.
@pnpm/logger
Advanced tools
@pnpm/logger is a logging utility designed for use with the pnpm package manager. It provides a structured way to log messages with different levels of severity and categories, making it easier to track and debug issues in pnpm-related projects.
Basic Logging
This feature allows you to log messages with different levels of severity such as info, warn, and error.
const logger = require('@pnpm/logger')('my-logger');
logger.info({ message: 'This is an info message' });
logger.warn({ message: 'This is a warning message' });
logger.error({ message: 'This is an error message' });
Custom Loggers
You can create custom loggers with specific namespaces to better organize your logging output.
const logger = require('@pnpm/logger');
const customLogger = logger('custom-namespace');
customLogger.info({ message: 'This is a custom info message' });
Structured Logging
This feature allows you to log structured data, making it easier to filter and analyze logs.
const logger = require('@pnpm/logger')('structured-logger');
logger.info({ event: 'user_signup', userId: 12345, message: 'User signed up successfully' });
Winston is a versatile logging library for Node.js that supports multiple transports (e.g., console, file, HTTP) and log levels. It offers more flexibility and customization options compared to @pnpm/logger.
Bunyan is a simple and fast JSON logging library for Node.js. It provides a structured logging format and includes features like log rotation and streaming. It is similar to @pnpm/logger in terms of structured logging but offers additional features like log rotation.
Pino is a low-overhead logging library for Node.js that focuses on performance. It provides fast and efficient logging with a simple API. Pino is more performance-oriented compared to @pnpm/logger.
Logger for pnpm
pnpm add @pnpm/logger
@pnpm/logger
is mostly just a wrapper over bole.
Logging is done the same way as in bole. To listed for logs, use streamParser
or create
a new parser with createStreamParser()
.
import logger, {streamParser} from '@pnpm/logger'
logger.debug({ foo: 'bar' })
streamParser.on('data', msg => {
// ...
})
MIT
FAQs
Logger for pnpm
We found that @pnpm/logger demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 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.
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.