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 🙏

© 2025 – Pkg Stats / Ryan Hefner

sugarconsole

v1.0.1

Published

Sugar functions for console object

Downloads

2

Readme

#sugarconsolejs

A simple collection of extensions to the console object to give you some sugar

##How to use

###npm

npm install sugarconsole --save-dev

###bower

bower install sugarconsole --save

###Download project

Menction our webpage at the script

	<script type="text/javascript" src="dist/sugarconsole.min.js"></script>

Extensions can be used directly from the global console object or by using the available sugarconsole class.

##Requirements

SugarConsole.js is zero dependencies. It is only necessary that the global object console exists.

##API

###.separator([size = 80, fontSize = 1])

Paint a line separator.

console.separator

We can indicate that it is shorter or longer using the size parameter and its thickness using the fontSize parameter, eg:

console.separator

###.sugar(msg [, fontSize = 1.2])

Paint the text in a sugary way.

console.sugar

Using the optional parameter fontSize we can make the text more or less large, eg:

console.sugar

###.xinfo([msg = "Empty Info text", infoObject = ""])

Paint an INFO text

console.xinfo

We can optionally pass you an object that will be logged after the text, eg:

console.xinfo

###.xerror([msg = "Empty Error text", errorObject = ""])

Paint an ERROR text

console.xerror

We can optionally pass you an object that will be logged after the text, eg:

console.xerror

###.xwarn([msg = "Empty Warning text", warnObject = ""])

Paint a WARNING text

console.xwarn

We can optionally pass you an object that will be logged after the text, eg:

console.xwarn

###.xdebug([msg = "Empty Debug text", debugObject = ""])

Paint a DEBUG text

console.xdebug

We can optionally pass you an object that will be logged after the text, eg:

console.xdebug

###.xlog([msg = "Empty Log text", fontSize = 1.2, fontFamily = "Arial"])

Paint a simple log text.

console.xlog

Optionally we can indicate the font size and typography, eg:

console.xlog

###.fontFamily(font)

With this method we can change the default typography when doing console.xlog

###.object(...)

Is console.log

###.strong([msg = "Empty bold text", fontSize = 1.2])

Paint a bold text.

console.strong

Optionally we can indicate the font size using the parameter fontSize.

###.italic([msg = "Empty italic text", fontSize = 1.2])

Paint an italic text.

console.italic

Optionally we can indicate the font size using the parameter fontSize.

###.quote([msg = "Empty quote text", fontSize = 1.2])

Paint a quoted text.

console.quote

Optionally we can indicate the font size using the parameter fontSize.

###.now([fontSize = 1.2])

Paint the current date. If this method was previously called, the difference with the previous date in milliseconds will also be painted.

console.now

console.now

###.step([reset = true])

With this method we can paint steps (the typical "Here step" in a slightly more elegant way.This method concretely paints the next step.We can indicate if you reset the steps or not.

console.step

console.step

console.step

If they pass more than 5 seconds between one step and another, they will automatically reset:

console.step

But we can force it not to do so using the reset parameter by passing it as false:

console.step

###.resetSteps()

Reset steps

###.stepNoReset()

Paint directly the next step without resetting even after 5 seconds. Same as doing .step(false).

###.stepWithReset()

Paint a step by forcing it to reset. Same as doing:

	console.resetSteps();
	console.step();

##Extra

We can also find things of no importance and/or that are of no use:

###.testlog()

Method to test that the extension has run:

console.testlog

###.logo()

This method simply paints the logo of SugarConsole.js

console.logo