Security News
JSR Working Group Kicks Off with Ambitious Roadmap and Plans for Open Governance
At its inaugural meeting, the JSR Working Group outlined plans for an open governance model and a roadmap to enhance JavaScript package management.
log-symbols
Advanced tools
The log-symbols package provides a set of symbols for use in console logging, which are especially useful for distinguishing different levels of log messages such as success, info, warning, and error. These symbols are cross-platform and will display correctly on different operating systems, including fallbacks for Windows.
Success Symbol
Displays a green check mark to indicate a successful operation.
const logSymbols = require('log-symbols');
console.log(logSymbols.success, 'Operation successful!');
Info Symbol
Displays a blue 'i' to represent an informational message.
const logSymbols = require('log-symbols');
console.log(logSymbols.info, 'Information message.');
Warning Symbol
Displays a yellow exclamation mark to signal a warning.
const logSymbols = require('log-symbols');
console.log(logSymbols.warning, 'Warning! Something needs attention.');
Error Symbol
Displays a red cross to indicate an error or a problem.
const logSymbols = require('log-symbols');
console.log(logSymbols.error, 'Error! Something went wrong.');
Chalk is a popular package that allows you to style and colorize text in the console. While it doesn't provide symbols, it is often used in conjunction with log-symbols to color the text accompanying the symbols for better visibility and emphasis.
Figures provides a set of unicode symbols that can be used in the console, similar to log-symbols. It includes more symbols than log-symbols, offering a wider variety of icons for different use cases.
Ora is a package that provides elegant terminal spinners. Although its primary feature is different, it includes symbols for success, info, warning, and error, which can be used similarly to log-symbols.
cli-spinners is a collection of spinners for use in the terminal, similar to ora. It also includes some static symbols, but its main focus is on animated spinners for long-running tasks.
Colored symbols for various log levels
Includes fallbacks for Windows CMD which only supports a limited character set.
$ npm install --save log-symbols
var logSymbols = require('log-symbols');
console.log(logSymbols.success, 'finished successfully!');
// On real OSes: ✔ finished successfully!
// On Windows: √ finished successfully!
MIT © Sindre Sorhus
FAQs
Colored symbols for various log levels. Example: `✔︎ Success`
We found that log-symbols 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.
Security News
At its inaugural meeting, the JSR Working Group outlined plans for an open governance model and a roadmap to enhance JavaScript package management.
Security News
Research
An advanced npm supply chain attack is leveraging Ethereum smart contracts for decentralized, persistent malware control, evading traditional defenses.
Security News
Research
Attackers are impersonating Sindre Sorhus on npm with a fake 'chalk-node' package containing a malicious backdoor to compromise developers' projects.