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

jquery.debug

v1.0.4

Published

This plugin helps managing debugging in javascript. It looks for a url param or cookie and prints conditional to the browser console.

Downloads

8

Readme

jquery.debug Build Status Code Climate

This plugin helps managing debugging in javascript. It looks for a url param or cookie and prints conditional to the browser console. it is useful if you want to log debug informations to the browser console on development hosts per default, but not in production. You can enable the debug mode in production via a url parameter.

Installation

bower install jquery.debug

Usage

javascript

$.debug(true);
$.debug.log('msg'); //prints to console

$.debug(false);
$.debug.log('msg'); //doesnt print to console

//sets 192.123.* hosts as development hosts
$.debug({developmentHosts: ['192.123.']})

It also exposes the class JQueryDebug for manual instantiating.

coffee script

$.debug true
$.debug.log 'msg' #prints to console

$.debug false
$.debug.log 'msg' #doesnt print to console

#adds 192.123.* hosts to development hosts
$.debug developmentHosts: [ '192.123.' ]

It also exposes the class JQueryDebug for manual instantiating and extending.

Parameter

developmentHosts

List of hosts or host-substrings for development host detection. Default is:

  • 127.0
  • 192.168
  • localhost

urlParam

Name of the url param to watch for, default is 'debug'. You van use:

  • ?debug=0
  • ?debug=false
  • ?debug=1
  • ?debug=true

cookieName

Name of the cookie for debug storing, default is 'debug'.

Functions

$.debug(configuration|debugMode|null)

Initialize the plugin.

  • with a configuration object.
  • or sets the debug mode if one of ['1', 1, 'true', true, '0', 0, 'false', false] is given.
  • If no parameter is given it returns the actual debug mode.

$.debug.config (options)

Updates the configuration.

$.debug.enable

Enables debug mode.

$.debug.disable

Disables debug mode.

$.debug.isEnabled

Returns the actual debug mode.

$.debug.setDebugMode (state)

Set the debug mode and stores it in the cookie. Valid values are:

  • 0
  • '0'
  • false
  • 'false'
  • 1
  • '1'
  • true
  • 'true'

$.debug.isDevelopment

Tells if the actual host is a development host.

$.debug.isProduction

Tells if the actual host is a production host.

$.debug.log (msg)

Logs a massage to the browser console if in debug mode.

$.debug.debug (msg)

Logs a debug massage to the browser console if in debug mode.

$.debug.error (msg)

Logs a error massage to the browser console if in debug mode.

$.debug.info (msg)

Logs a info massage to the browser console if in debug mode.

$.debug.warn (msg)

Logs a warning massage to the browser console if in debug mode.

$.debug.alert (msg)

Alerts a massage if in debug mode.

Dependencies

Resources

  • https://github.com/creative-workflow/jquery.debug
  • https://travis-ci.org/creative-workflow/jquery.debug
  • https://codeclimate.com/github/creative-workflow/jquery.debug
  • http://bower.io/search/?q=jquery.debug

Authors

Tom Hanoldt

Contributing

Check out the Contributing Guidelines