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

colorlog-css

v1.0.11

Published

🌈 Colorize ugly console.log with your css !

Downloads

21

Readme

colorlog-css

npm version LICENSE

🌈 Colorize your ~~ugly~~ console.log with 198 Schemes and your CSS !

~~0 dependencies & 0 dependents~~ light weight module :)

Installation

npm install colorlog-css --save
yarn add colorlog-css

Usage

Javascript

var colorLog = require('colorlog-css')
var clg = new colorLog.default('./MyColors.css')
// var clg = new colorLog.default()
// clg.set('./MyColors.css')

clg.log('I want a default color')
clg.pri('But I wanna more pretty log')

TypeScript

import ColorLog from 'colorlog-css'

const clg = new ColorLog('./MyColors.css')
// const clg = new ColorLog()
// clg.set('./MyColors.css')

clg.list()
clg.suc('cess :)')
clg
  .join()
  .log('log')
  .pri('pri')
  .sec('sec')
  .suc('suc')
  .danger('danger')
  .warn('warn')
  .info('info')
  .end()

There are already 198 schemes based on the iterm-scheme list and 3/4 bit default style. You can easily modify your color with these predefined colors and your CSS.

clg.list() // Will show the default 3/4 bit style list.
clg.listScheme() // List schemes with methods of scheme applied.

import { Schemes } from 'colorlog-css'
// Schemes will applied to the methods πŸ•Ά
clg.setScheme(Schemes.Batman)

How to change color ?

Make a CSS file for customizing your own color :)

  • Selectors
    • Class Format ( Each selector will represent method's color)
      • .primary
      • .secondary
      • .success
      • .danger
      • .warning
      • .info
      • .default
    • Id Format
      • #pre
        • val ( property represent the value of prefix )
/* SAMPLE */

.success {
  background: #00bc80;
  color: rgb(255, 255, 255);
}

/* .default #pre {
  background: null;
  color: #ffffff;
  val: *Default*;
} */

.primary #pre {
  background: rgb(0, 115, 216);
  color: rgb(255, 255, 255);
  val: 🌈 HEY;
}

.secondary #pre {
  background: #514636;
  color: rgb(235, 244, 255);
  val: β˜•οΈ Hmm..;
}

.success #pre {
  background: #58ff82;
  color: rgb(33, 33, 33);
  val: βœ… Great !;
}

.danger #pre {
  background: #ff7dab;
  color: rgb(0, 0, 0);
  val: πŸ”₯ πŸ”₯ WATCH OUT;
}

.warning #pre {
  background: #ffdc2e;
  color: rgb(0, 0, 0);
  val: πŸ’© Shit;
}

.info #pre {
  background: rgba(0, 170, 189, 0.612);
  color: rgb(255, 255, 255);
  val: ⭐️ __NOTE__ ⭐️;
}
import ColorLog from 'colorlog-css'

const clg = new ColorLog('./MyColors.css')
clg
  .join()
  .log('log')
  .pri('pri')
  .sec('sec')
  .suc('suc')
  .danger('danger')
  .warn('warn')
  .info('info')
  .end()

or programmatically,

import ColorLog, { Colors, Style } from 'colorlog-css'

const clg = new ColorLog('./MyColors.css')

clg.info('You can change the color like this', '\n\n')

clg.danger('danger')

// Apply only background
clg.categories.danger.color = clg.makeForm(null, '#ff4757')
clg.danger('danger')

// Apply styles and colors
clg.categories.danger.color = clg.makeForm(
  [Colors.Magenta, Style.Italic, Style.Bold],
  '#7bed9f'
)
clg.danger('danger')

Output will look like this ✨

TODO...

  • [x] Make it available to customize default color set.
    • [x] Customize it with schemes / inputing the value directly.
  • [x] Change font styles with string or string[] types
  • [ ] Any ideas? πŸ˜„

Any questions or suggestions are always welcome πŸ€