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

cutesy.js

v1.2.3

Published

a cute color logger

Downloads

16

Readme

cutesy

a cute javascript logger with helpful utility <3 some updates still expected

How to use it

Create a logger

const Logger = require('cutesy.js')
const logger = new Logger()

Change color

You can easily change the color with our color pallet consitent of currently 15 colors

const colors = [
    "black", "white", "red", "darkGreen", "green",
    "darkBlue", "blue", "cyan", "purpleBlue", "lightBlue", 
    "purple", "lightPurple", "yellow", "pink", "orange"
]

logger.blue()
.send("you can do it like this")

logger.blue("or like this")
.send()

logger.blue("you even can change the color ")
.red("in the same message, ")
.green("by chaining colors together!")
.send()

logger.rainbow("and if you are very funny, use this :)")
.send()

Add Timestamp

You want a timestamp added to know when the log was made? No problem! We have multiple formats for all needs.

logger.addTimestamp("hh:mm:ss")
logger.send("This text has a timestamp") // => 04:31:05 - This text has a timestamp

Prefixes/Names

You can add a prefix to know what type of log you are recieving

logger.changeTag("Debug")
.send("This text is a debug") // => [Debug] | This text is a debug

Using multiple Logger in the same console can look good :-)

logger1.changeTag("Debug", 12) // 12 is the minimum Length of the Tag (before " | ")
.send("This text is a debug"); // => [Debug]      | This text is a debug

logger2.changeTag("Production", 12)
.send("This text is a debug"); // => [Production] | This text is a debug

logger3.changeTag("Test", 12)
.send("This text is a debug"); // => [Test]       | This text is a debug

#### Traces

You don't know where the log comes from? add a stack trace!

```js
logger.sendTraced("This text got sent with a trace") // => This text got sent with a trace | /home/cutesy/project/index.js:10:12

Log into files

ever want to log stuff into a file? now you can with just one line! it automatically appends the log on each save

logger.save("./log.txt", "This text is in a file")

//log.txt:
//This text is in a file

logger.send("We save this in a context")
.save("./log.txt")

//log.txt:
//This text is in a file
//We save this in a context

Example

Here we want to have a blue color, with the "Info" tag to log into the console, and then into a file.

const Logger = require('cutesy.js')
const logger = new Logger()

logger.blue()
.changeTag("Info")
.send("This information gets logged into a file")
.save("./log.txt") //we don't need to define a message since we have a context

Tips

The Logger uses the same Tag, Timestamp and Color unless you want to change it.

logger.blue()
.changeTag("Info")
.addTimestamp("hh:mm:ss")
.send("I like the color blue") //-> [Info] | 00:55:29 - I like the color blue

logger.send("This stays blue") //-> [Info] | 00:55:29 - This stays blue

logger.red()
.send("until you change the color") //-> [Info] | 00:55:29 - until you change the color

logger.reset()
.send("and you can start all over again") //-> and you can start all over again