Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@santi100/coloring-lib

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@santi100/coloring-lib

This is a coloring library that uses ANSI sequences to color text on a terminal. Be aware there might be bugs hidden in this code. Pull requests and issues are welcome!

  • 1.0.4
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
4
decreased by-20%
Maintainers
1
Weekly downloads
 
Created
Source

Santi's Coloring Library (JavaScript)

This is a coloring library that uses ANSI sequences to color text on a terminal. Be aware there might be bugs hidden in this code. Pull requests and issues are welcome!

Usage

Importing from a JavaScript File

Via NPM

Import @santi100/coloring-lib (for ESM) or @santi100/coloring-lib/cjs (for CJS).

Via Source Control

Import ./coloring-lib/index.js (ESM) or ./coloring-lib/cjs/index.js (CJS).

Installation

Via NPM
  • Run npm install @santi100/coloring-lib, yarn add @santi100/coloring-lib, or pnpm install @santi100/coloring-lib, depending on what package manager you use in your project.
Via Source Control
  • Run git clone https://github.com/santi100a/coloring-lib.
  • Enter the directory and run npm install, yarn install, or pnpm install to install dependencies.

Functions

coloring(string: string, color: Color): string; This function takes in a string to color, and a color, which can be one of 11 colors/effects: red, yellow, green, black, blue, magenta, cyan, white, bold, conceal and blink.

coloring(string: string, color: Color[]): string; This function takes in a string to color, and an array of the aforementioned colors/effects. If you put two colors, the latter one/s will override the former/s.

class Coloring: This is a colorizer object class. Its instance methods are called the same as the colors/effects, and you can chain them. To convert the object to a string, call the Coloring.prototype.resolve() method.

FAQs

Package last updated on 07 Dec 2022

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc