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

atomic_color

v1.2.1

Published

This a Brand new Color library with more easy implementation

Downloads

8

Readme

atomic_color

A comprehensive npm package for styled console output using Chalk.js.

Installation

npm install atomic_color
import { red,green,blue,yellow,cyan,magenta,white,gray,black,bgRed,bgGreen,bgBlue,BgYellow,bgCyan,bgMagenta,bgWhite,bgBlack,bold,dim,italic,underline,inverse,strikethrough,success,error,warning, info,rainbow } from 'atomic_color';

success('Operation completed successfully!');
error('An error occurred!');
warning('This is a warning!');
info('This is an informational message.');
console.log(red('This is red text.'));
console.log(bgGreen('This is text with a green background.'));
console.log(italic('This is italic text.'));
console.log(rainbow('This is rainbow text.'));

exampleUsage();

    console.log(success('Success: Operation completed successfully!'));
    console.log(error('Error: An error occurred!'));
    console.log(warning('Warning: This is a warning!'));
    console.log(info('Info: This is an informational message.'));
    console.log(red('This is red text.'));
    console.log(bgGreen('This is text with a green background.'));
    console.log(italic('This is italic text.'));
    console.log(rainbow('This is rainbow text.'));

// index.js
import chalk from 'chalk';

// Text Colors
export const red = (message) => chalk.red(message);
export const green = (message) => chalk.green(message);
export const blue = (message) => chalk.blue(message);
export const yellow = (message) => chalk.yellow(message);
export const cyan = (message) => chalk.cyan(message);
export const magenta = (message) => chalk.magenta(message);
export const white = (message) => chalk.white(message);
export const gray = (message) => chalk.gray(message);
export const black = (message) => chalk.black(message);

// Background Colors
export const bgRed = (message) => chalk.bgRed(message);
export const bgGreen = (message) => chalk.bgGreen(message);
export const bgBlue = (message) => chalk.bgBlue(message);
export const bgYellow = (message) => chalk.bgYellow(message);
export const bgCyan = (message) => chalk.bgCyan(message);
export const bgMagenta = (message) => chalk.bgMagenta(message);
export const bgWhite = (message) => chalk.bgWhite(message);
export const bgBlack = (message) => chalk.bgBlack(message);

// Text Styles
export const bold = (message) => chalk.bold(message);
export const dim = (message) => chalk.dim(message);
export const italic = (message) => chalk.italic(message);
export const underline = (message) => chalk.underline(message);
export const inverse = (message) => chalk.inverse(message);
export const strikethrough = (message) => chalk.strikethrough(message);

// Combined Functions
export const success = (message) => chalk.green.bold(message);
export const error = (message) => chalk.red.bold(message);
export const warning = (message) => chalk.yellow.bold(message);
export const info = (message) => chalk.blue.bold(message);

// Rainbow Colors (custom)
export const rainbow = (message) => {
    const colors = [chalk.red, chalk.yellow, chalk.green, chalk.cyan, chalk.blue, chalk.magenta];
    return message.split('').map((char, i) => colors[i % colors.length](char)).join('');
};

// Example usage function
export const exampleUsage = () => {
    console.log(success('Success: Operation completed successfully!'));
    console.log(error('Error: An error occurred!'));
    console.log(warning('Warning: This is a warning!'));
    console.log(info('Info: This is an informational message.'));
    console.log(red('This is red text.'));
    console.log(bgGreen('This is text with a green background.'));
    console.log(italic('This is italic text.'));
    console.log(rainbow('This is rainbow text.'));
};