npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

chalk-terminal

v1.0.1

Published

A chalk-like terminal string styling utility for Node.js, allowing colored and styled console output.

Readme

chalk-terminal

🇻🇳 Phiên bản Tiếng Việt

Giới thiệu

chalk-terminal là một thư viện Node.js nhỏ gọn giúp tô màu và định dạng văn bản trong terminal bằng mã ANSI. Thư viện hỗ trợ:

Màu cơ bản (red, green, blue, …) và màu sáng (brightRed, brightGreen, …)

Màu 24-bit (RGB) và hex

Tên màu tuỳ chỉnh (orange, pink, teal, …)

Hiệu ứng tô đậm (bold), nghiêng (italic), gạch chân (underline), ẩn (hidden), hoán vị (inverse), v.v.

Chuỗi chain-style như chalk.red.bold.underline("text")

Hỗ trợ template literal và ép kiểu tự động

Cài đặt

npm install chalk-terminal

hoặc

yarn add chalk-terminal

Sử dụng cơ bản

const chalk = require('chalk-terminal');

console.log(chalk.red('Hello world!')); console.log(chalk.green.bold('Success!')); console.log(chalk.blue.underline('Link: http://example.com'));

Sử dụng RGB, HEX và tên màu

// RGB console.log(chalk.rgb(255, 165, 0)('Orange by RGB'));

// HEX console.log(chalk.hex('#ff00ff')('Magenta by HEX'));

// Tên màu console.log(chalk.name('teal')('Teal named color'));

Hiệu ứng nền (Background)

console.log(chalk.bgBlue.white('White on Blue background')); console.log(chalk.bgName('gold').black('Black text on Gold'));

API chính

Phương thức Miêu tả

chalk.colorName(text) Tô màu theo ANSI cơ bản chalk.rgb(r,g,b)(text) Tô màu 24-bit theo giá trị RGB chalk.hex(hexCode)(text) Tô màu theo mã HEX chalk.name(colorName) Tô màu theo tên định sẵn trong thư viện chalk.bgColor Tô màu nền tương ứng (vd: bgRed, bgRgb…) chalk.bold(text) In đậm chalk.italic(text) In nghiêng chalk.underline(text) Gạch chân chalk.inverse(text) Hoán vị (đổi màu nền và chữ) chalk.reset Reset tất cả hiệu ứng

Tích hợp Template Literals

const name = 'Alice'; console.log(chalk.redXin chào ${name}, chúc bạn một ngày tốt lành!);

Tùy biến nâng cao

Bạn có thể kết hợp nhiều hiệu ứng:

console.log(chalk.bold.underline.rgb(128,0,128)('Custom Purple Bold Underline'));

Giấy phép

Thư viện chalk-terminal được cấp phép theo MIT License.


🇬🇧 English Version

chalk-terminal

Introduction

chalk-terminal is a lightweight Node.js library for coloring and styling terminal text with ANSI codes. Features:

Basic colors (red, green, blue, …) and bright variants (brightRed, brightGreen, …)

24-bit color support (RGB) and HEX

Custom named colors (orange, pink, teal, …)

Text styles: bold, italic, underline, hidden, inverse, etc.

Chainable syntax: chalk.red.bold.underline("text")

Template literal support and automatic string coercion

Installation

npm install chalk-terminal

or

yarn add chalk-terminal

Basic Usage

const chalk = require('chalk-terminal');

console.log(chalk.red('Hello world!')); console.log(chalk.green.bold('Success!')); console.log(chalk.blue.underline('Link: http://example.com'));

Using RGB, HEX and Named Colors

// RGB console.log(chalk.rgb(255, 165, 0)('Orange by RGB'));

// HEX console.log(chalk.hex('#ff00ff')('Magenta by HEX'));

// Named Color console.log(chalk.name('teal')('Teal named color'));

Background Styles

console.log(chalk.bgBlue.white('White on Blue background')); console.log(chalk.bgName('gold').black('Black text on Gold background'));

Core API

Method Description

chalk.colorName(text) Apply basic ANSI color chalk.rgb(r,g,b)(text) Apply 24-bit RGB color chalk.hex(hexCode)(text) Apply HEX color chalk.name(colorName) Apply custom named color from the library chalk.bgColor Background color (e.g., bgRed, bgRgb, etc.) chalk.bold(text) Bold text chalk.italic(text) Italic text chalk.underline(text) Underlined text chalk.inverse(text) Inverse (swap foreground and background) chalk.reset Reset all styles

Template Literal Integration

const name = 'Alice'; console.log(chalk.redHello ${name}, have a great day!);

Advanced Customization

Combine multiple styles:

console.log(chalk.bold.underline.rgb(128,0,128)('Custom Purple Bold Underline'));

License

The chalk-terminal library is licensed under the MIT License.