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 🙏

© 2024 – Pkg Stats / Ryan Hefner

colorize-console

v1.0.5

Published

Ponnle color a tus textos de consola

Downloads

28

Readme

Librería de Colores para Consola

Esta librería proporciona una manera fácil de aplicar colores y estilos al texto en la consola de Node.js.

Instalación

Puedes instalar la librería utilizando npm:

npm install --save colorize-console

También puedes clonar el repositorio desde GitHub y usarlo directamente:

git clone https://github.com/Alexito-Hub/colorize-console.git

Uso

Para utilizar la librería, primero debes importar el módulo colorize:

// Para ES Module
import colorize from 'colorize-console';

// Para CommonJS
const colorize = require('colorize-console');

Colores de Texto

Puedes aplicar colores a tu texto utilizando los métodos disponibles en colorize:

  • black(text)
  • red(text)
  • green(text)
  • yellow(text)
  • blue(text)
  • magenta(text)
  • cyan(text)
  • white(text)
  • gray(text)
  • brightRed(text)
  • brightGreen(text)
  • brightYellow(text)
  • brightBlue(text)
  • brightMagenta(text)
  • brightCyan(text)
  • brightWhite(text)

Ejemplo:

console.log(colorize.red('Este texto es rojo'));

Colores de Fondo

También puedes especificar un color de fondo para el texto utilizando el segundo parámetro en los métodos anteriores:

  • black(text, background)
  • red(text, background)
  • green(text, background)
  • yellow(text, background)
  • blue(text, background)
  • magenta(text, background)
  • cyan(text, background)
  • white(text, background)
  • gray(text, background)
  • brightRed(text, background)
  • brightGreen(text, background)
  • brightYellow(text, background)
  • brightBlue(text, background)
  • brightMagenta(text, background)
  • brightCyan(text, background)
  • brightWhite(text, background)

Ejemplo:

console.log(colorize.red('Texto en rojo con fondo blanco', 'white'));

Estilos

Además de colores, puedes aplicar diferentes estilos al texto:

  • bold(text)
  • italic(text)
  • underline(text)
  • inverse(text)
  • strike(text)

Ejemplo:

console.log(colorize.bold('Texto en negrita'));

Colores Personalizados

También puedes especificar colores personalizados utilizando RGB. Esto requiere los métodos custom y rgb:

  • custom(text, r, g, b, background, a = 1)
  • rgb(text, r, g, b, background, a = 1)

Ejemplo:

console.log(colorize.custom('Texto con color personalizado', 255, 0, 0)); // Rojo
console.log(colorize.rgb('Texto con color RGB', 0, 255, 0)); // Verde

Documentación Completa

Para consultar la documentación completa, visita unknown/colorize-console-docs.

Soporte

Si necesitas ayuda o tienes alguna pregunta sobre la librería, por favor visita unknown o contáctanos en iamzio.outlook.com.