Awesome
deb.js
~1.5K minimalistic JavaScript library for debugging in the browser
- works on functional level
- groups your
console.log
statements and place them in a proper context - displays stack traces, passed arguments and execution time
Usage
Add deb.min.js
at the top of your page. Before every other script file.
<script src="deb.min.js"></script>
Add .deb()
After the definition of your functions.
var calculateSomething = function(cb) {
// ...
}.deb();
Open your console. You should see something like that:
Use .debc()
to collapse the output.
Deb.js as Chrome extension
There is extension for Chrome that injects deb.min.js
into your page. All you have to do is to install the extension from here and click the icon in the upper right corner.
Once you do that the extension will inject the file before your page's content and you will be able to use .deb()
or debc()
methods.
Deb.js is available in Bower too
To install the library via Bower just run:
bower install deb.js
The file that you probably want to use is /bower_components/deb.js/build/deb.min.js
.
Articles
Preview
Here is an animated gif that demonstrates how Deb.js outputs information about the executed function.
Building
npm install
npm run build