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

my-console

v1.6.0

Published

Use console with timestamp and controll it in production version.

Downloads

16

Readme

my-console

Drop-in replacement for console - a cross-environment fix for missing methods.

Installation

Just include the script. The host my-console object is automatically updated in your environment. No need for new or any other sort of initialization.

Node.js

$ npm [-g] install my-console

Then require the "my-console" module:

var console = new (require("my-console")).Console();

Reset the Log level

* console.level = console.LEVELS.DEVELOPMENT; // default

* console.level = console.LEVELS.INFO;

* console.level = console.LEVELS.WARN;

* console.level = console.LEVELS.ERROR;

* console.level = console.LEVELS.LOG;

* console.level = console.LEVELS.SUCCESS;

* console.level = console.LEVELS.PRODUCTION;

* console.level = [console.LEVELS.LOG,console.LEVELS.INFO];

* console.level = []; //stop all logs

#Examples

/**
 * Created by pawanpawar on 3/6/17.
 */
var console = new (require("./console")).Console();
console.datetime = true;
console.fileName = true;
console.lineNumber = true;
console._repeater = true;

console.repeater("=", 100);
console.info("Default console level (DEVELOPMENT)");
console.log("I am `console.log` example");
console.info("I am `console.info` example");
console.error("I am `console.error` example");
console.warn("I am `console.warn` example");
console.repeater("#", 100);
console.level = console.LEVELS.DEVELOPMENT;
console.info("Setting console level to INFO");
console.level = console.LEVELS.INFO;
console.log("I am `console.log` example");
console.info("I am `console.info` example");
console.error("I am `console.error` example");
console.warn("I am `console.warn` example");
console.repeater("@", 100)
console.level = console.LEVELS.DEVELOPMENT;
console.info("Setting console level to WARN");
console.level = console.LEVELS.WARN;
console.log("I am `console.log` example");
console.info("I am `console.info` example");
console.error("I am `console.error` example");
console.warn("I am `console.warn` example");
console.repeater("$", 100);
console.level = console.LEVELS.DEVELOPMENT;
console.info("Setting console level to LOG");
console.level = console.LEVELS.LOG;
console.log("I am `console.log` example");
console.info("I am `console.info` example");
console.error("I am `console.error` example");
console.warn("I am `console.warn` example");
console.repeater("%", 100);
console.level = console.LEVELS.DEVELOPMENT;
console.info("Setting console level to ERROR");
console.level = console.LEVELS.ERROR;
console.log("I am `console.log` example");
console.info("I am `console.info` example");
console.error("I am `console.error` example");
console.warn("I am `console.warn` example");
console.repeater("^", 100);
console.level = console.LEVELS.DEVELOPMENT;
console.info("Setting console level to PRODUCTION");
console.level = console.LEVELS.PRODUCTION;
console.log("I am `console.log` example");
console.info("I am `console.info` example");
console.error("I am `console.error` example");
console.warn("I am `console.warn` example");
console.repeater("&", 100);
console.level = console.LEVELS.DEVELOPMENT;
console.info("Setting console level to WARN and LOG");
console.level = [console.LEVELS.WARN, console.LEVELS.LOG];
console.log("I am `console.log` example");
console.info("I am `console.info` example");
console.error("I am `console.error` example");
console.warn("I am `console.warn` example");
console.repeater("*", 100);
console.level = console.LEVELS.DEVELOPMENT;
console.info("Setting console level to INFO and ERROR");
console.level = [console.LEVELS.INFO, console.LEVELS.ERROR];
console.log("I am `console.log` example");
console.info("I am `console.info` example");
console.error("I am `console.error` example");
console.warn("I am `console.warn` example");
console.repeater("~", 100);
console.level = console.LEVELS.DEVELOPMENT;
console.info("Stop all console msgs.");
console.level = console.LEVELS.STOP;
console.log("I am `console.log` example");
console.info("I am `console.info` example");
console.error("I am `console.error` example");
console.warn("I am `console.warn` example");
console.repeater("+", 100);
console.level = console.LEVELS.DEVELOPMENT;
console.repeater("/", 100);
console.info("Setting console level to INFO and LOG");
console.level = [console.LEVELS.INFO, console.LEVELS.LOG];
console.log("I am `console.log` example");
console.assert(false, "I am `console.assert` example and condition is false");
console.assert(true, "I am `console.assert` example and condition is true");
console.info("I am `console.info` example");
console.error("I am `console.error` example");
console.warn("I am `console.warn` example");
console.success("I am `console.success` example");
console.repeater("-", 100);

console.info('Also add new functions');
console.info('console.profile(reportName)');
console.info('console.profileEnd()');
console.info('console.select(element)');
console.info('console.table(tabularData)');
console.info('console.time(label)');
console.info('console.timeEnd(label)');
console.info('console.timeStamp(label)');
console.info('console.timeline(label)');
console.info('console.timelineEnd(label)');

#The above example will output:

examples