Socket
Socket
Sign inDemoInstall

picocolors

Package Overview
Dependencies
0
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    picocolors

The tiniest and the fastest coloring library ever


Version published
Maintainers
1
Install size
6.61 kB
Created

Package description

What is picocolors?

The picocolors npm package is a minimalistic library for coloring terminal text. It provides a simple and efficient way to add color to console output in Node.js applications. The package is designed to be lightweight and fast, making it an excellent choice for projects that require colored output without the overhead of more feature-rich libraries.

What are picocolors's main functionalities?

Text coloring

This feature allows you to color text output in the terminal. The example demonstrates how to make text appear red.

"const pico = require('picocolors');\nconsole.log(pico.red('This text is red'));"

Text styling

This feature enables you to apply styles such as bolding to your text output. The example shows how to make text bold.

"const pico = require('picocolors');\nconsole.log(pico.bold('This text is bold'));"

Background coloring

With this feature, you can set the background color of your text output. The example illustrates setting a green background for the text.

"const pico = require('picocolors');\nconsole.log(pico.bgGreen('This text has a green background'));"

Other packages similar to picocolors

Changelog

Source

v0.2.0

  • Removed ESM Module to fix the rest of compatibility issues and reduce package size (#26)
  • Added support for non-string inputs (3276400)

Readme

Source

picocolors

npm install picocolors

A tinier and faster alternative to nanocolors. Andrey, are you even trying?

import pc from "picocolors";

console.log(pc.green(`How are ${pc.italic(`you`)} doing?`));
  • Up to 2x faster and 2x smaller than alternatives
  • 3x faster and 10x smaller than chalk
  • TypeScript support
  • NO_COLOR friendly
  • Node.js v6+ & browsers support
  • The same API, but faster, much faster
  • No String.prototype modifications (anyone still doing it?)
  • No dependencies and the smallest node_modules footprint

Docs

Read full docs on GitHub.

Keywords

FAQs

Last updated on 03 Oct 2021

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc