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

qulog

v1.0.3

Published

A fast, simple, UMD, cross-browser way to use console.log during development & testing.

Downloads

24

Readme

Qulog Build Status

(Quickly Usable Log) ["que-log"]

A fast, simple, UMD, cross-browser way to use console.log during development & testing.

To support this project, you can at the support page by supporting the developer.

Getting Started

NPM (What is NPM? What is Grunt?)

npm install qulog --save-dev

Bower (What is Bower?)

bower install qulog --save-dev

Download directly (Do not link this directly on your site, the file is sent with a plain/text header and can cause loading problems)

API & Usage

Aiming the convenience and favours of developers, turning on and off the logging made possible with toggle-pairs. The toggle-pairs allow to set on/off logging by the properties and functions below using boolean (true/false) values.

| Property | Functionality | Example | | ----------- | ------------- | ------- | | .on | turns on or off output to console (true/false) | qulog.on = true OR qulog.on = false | | .off | turns off or on output to console (true/false) | qulog.off = true OR qulog.off = false | | .debug | same as .on | qulog.debug = true OR qulog.debug = false | | .production | same as .off | qulog.production = true OR qulog.production = false |

| Function | Functionality | Example | | ----------- | ------------- | ------- | | .setOn(true/false) | turns on or off output to console (true/false) | qulog.setOn(true) OR qulog.setOn(false) | | .setOff(true/false) | turns off or on output to console (true/false) | qulog.setOff(true) OR qulog.setOff(false) | | .setDebug(true/false) | same as .setOn() | qulog.setDebug(true) OR qulog.setDebug(false) | | .setProduction(true/false) | same as .setOff() | qulog.setProduction(true) OR qulog.setProduction(false) |

By default, qulog is turned on. (qulog.on === true)

In Node.js

    var qulog = require("./node_modules/qulog");

In Browser (NPM)

    <script src="node_modules/qulog/qulog.js"></script>

In Browser (Bower)

    <script src="bower_components/qulog/qulog.js"></script>

In Browser (Require.js)

    <script>
        require(["scripts/qulog"], function(qulog) {
                /* qulog is accessible from now on */
        });
    </script>

In Browser (Directly downloaded source)

    <script src="scripts/qulog.js"></script>

In the code:

During development & testing:

    /* after assigned qulog to a variable called "log" */
    function testFunctionality() {
        /* This below should appear in console */
        log("-> testFunctionality was called");
        /* Do logic afterwards */
    };

Turn off output to console:

    /* after assigned qulog to variable called "log" */
    log.on = false; 

    function testFunctionality() {
        /* This below SHOULD NOT appear in console */
        log("-> testFunctionality was called");
        /* Do logic afterwards */
    };

Using other functions for achieving the same functionality (toggle-pairs)

    /* after assigned qulog to variable called "log" */

    /* These will turn off output to console
       and they are functionally equivalent, toggle-pairs */
    log.on = false; /* or */ log.debug = false;
    /* or */
    log.off = true; /* or */ log.production = true;
    
    function testFunctionality() {
        /* This below SHOULD NOT appear in console */
        log("-> testFunctionality was called");
        /* Do logic afterwards */
    };
    
    /* To turn on output to console again */
    log.on = true; /* or */ log.debug = true;
    /* or */
    log.off = false; /* or */ log.production = false;

    function testFunctionality() {
        /* This below should appear in console */
        log("-> testFunctionality was called");
        /* Do logic afterwards */
    };

In Internet Explorer 8 and Below:

    /* after assigned qulog to variable called "log" */
    
    /* Properties (.on/.off/.debug/.production)
       are not available in IE8 and lower
       Use instead the appropriate functions */
    log.setOn(false); /* or */ log.setDebug(false);
    /* or */
    log.setOff(true); /* or */ log.setProduction(true);

    function testFunctionality() {
        /* This below SHOULD NOT appear in console */
        log("-> testFunctionality was called");
        /* Do logic afterwards */
    };

Internet Explorer 8 and Below

As this tool is intended to use with and tested too with IE9+ and with modern browsers, although works well with IE8, it is not recommended to use with IE8 or lower.

  • use setOn/setOff and setDebug/setProduction instead of .on/.off/.debug/.production properties (IE8 properties issue)
  • jasmine tests in IE8 or lower will fail

Suggestions, Ideas & Requests

Post any occurring suggestions, useful ideas and requests to the project's issue page under the suggestion/idea/request label by clicking here.

  • Constructive criticism is encouraged and welcomed by contacting the developer or using GitHub.

Issues/Bugs

In case of any occurring issues and/or bugs, post on the project's issues page with appropriate label(s).

Support

If you find this tool useful, you can support this project by supporting the developer here.

Contribution & A Note

In the spirit of open source software development, this project is always open to and encourages community code contribution. To get started, just run through the source file, check the comments and general coding style and start to contribute.

  • In case you find this tool useful, support it by supporting the developer, follow the developer on social platforms or send an email to the developer.

License

Copyright (c) 2014 "Richard KnG" Richárd Szakács. Licensed under the MIT license.

The license mentioned above applies to all parts of this software except as documented below

All files located in the node_modules and external directories are externally maintained libraries used by this software which have their own licenses. We recommend you read them, as their terms may differ from the terms above.