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

waveless

v2.1.6

Published

This is a npm package to convert the simple and boring console debug in node js to a fun and useful console, then, this:

Downloads

28

Readme

Waveless

This is a npm package to convert the simple and boring console debug in node js to a fun and useful console, then, this:

boring

become to this:

cool

Usage

const waveless = require('waveless')();

waveless.log('I am a log');
waveless.info('I am some info');
waveless.warning('prision break!');
waveless.error('[] != []');
waveless.danger('Robot rock');

// You can also pass a second argument called showAsObject
// for the first argument (data to print in console) show as an object and its type

waveless.log([], true);
waveless.log({"foo": "bar"}, true);
waveless.log("string", true);
waveless.log(true, true);

// The result from above will be like the image below

objects

Options

The constructor has an argument called options which is an object with the following defaults

| Option | Default Value | Description | | --------------- | --------------------- | ------------------------------------------------------------- | | writeInFile | false | A boolean option to write all the logs into a file specified. | | timestampFormat | DD-MM-YYYY HH:mm:ss | A momentjs date format string. | | filePath | null | The absolute file path to write all the logs. | | indentSpaces | 4 | The indent spaces of the log start. |

const waveless = require('waveless')({
    writeInFile: true,
    filePath: './logs/waveless/log',
    // display on the console and write into the file only the time
    timestampFormat: 'HH:mm:ss'
});

There is also a method called setOptions(options) which receives the same options as the constructor.

Note

If you set the options in the constructor and then you call the setOptions(options) method the options given in the constructor will be overwritten by the options given in the setOptions(options) method

Example of log file

13-01-2019 18:35:59 | log | "I am a log" | 0.242ms
13-01-2019 18:35:59 | info | "I am some info" | 0.002ms
13-01-2019 18:35:59 | error | "[] != []" | 0.002ms
13-01-2019 18:35:59 | warning | "prision break!" | 0.002ms
13-01-2019 18:35:59 | danger | "Robot rock" | 0.002ms
13-01-2019 18:38:50 | log | [] | 0.244ms
13-01-2019 18:38:50 | log | {
  "foo": "bar"
} | 0.002ms
13-01-2019 18:38:50 | log | "string" | 0.002ms
13-01-2019 18:38:50 | log | true | 0.002ms

Migration and update package

The last version of this package in npm was the 1.1.6 if you want to update to this release (2.1.6) the only thing you must do is instantiate the package and set it as constant like this:

// Old version, don't do it this way
var waveless = require('waveless');

Change your above code for this code below

// New version
const waveless = require('waveless')();