1.2.0 • Published 6 years ago

jsbug v1.2.0

Weekly downloads
33
License
ISC
Repository
github
Last release
6 years ago

Simple, colorful javascript debugging on demand

Append ?jsbug=true to url in order to enable logging through jsbug within your browser console. And simply add ?jsbug=false to disable it. Jsbug is enabled/disabled through localstorage and will not perform anything if not enabled. It´s incredibly lightweight and do not require any dependencies.

👉 Try it 👈

Install jsbug

npm install --save jsbug

Make it a part of the project

// Require it
var debug = require("jsbug");

// Or import it
import debug from 'jsbug'

Usage

Basic debugging
// Print "♢ Clicked a button" using blue color
debug("Clicked a button");
Changing the color output
// Print "♢ Clicked another button" using a purple color
debug("Clicked another button", { color: '#6A36CB' });
Indicate ajax calls (start msg with a pipe)
// Print "| Requesting api" using yellow color
debug("| Requesting API");
Indicate success
// Print "* JSON returned" using green color
debug("JSON returned", { success: true });
Indicate failure
// Print "@ Failure! Unexpected result" using red color
debug("Unexpected result", { success: false });
Indicate failure with grouped, inspectable properties
// Print "@ Failure: Unexpected result" using red color and make response object inspectable
debug("Unexpected result", { success: false, group: [response] });

Screenshots

Sample code

Screenshot

Default result (collapsed)

Screenshot

Expanded result

Screenshot

Support

Most modern browsers. Feel free to contribute!

1.2.0

6 years ago

1.1.0

6 years ago

1.0.11

7 years ago

1.0.10

7 years ago

1.0.9

7 years ago

1.0.8

7 years ago

1.0.7

7 years ago

1.0.6

7 years ago

1.0.5

7 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

8 years ago

1.0.0

8 years ago