🍺 Debug on tap.
Why?
Helps afford the creation of data-driven, narrative user journeys, aka. log level 'human'.
- Plays nicely with the
then()
andtap()
methods of your promises as well as functional pipelines. - ES6-style variable interpolation built in.
- Colored output makes it easy to spot variables and their values.
- ✌️👌😍 Emojis 🙌🔥🌟
Example
'use strict'; var debug = 'icebox:checker';var see = debug; var checkIcebox = get; { var { return iceboxplum > 0; }; return ;}
See these examples for further usage instructions.
API
require('tap-debug')(debugFn, options)
Takes a debugFn
such as visionmedia/debug and a configuration options
object.
stringifyValue: false stringifyValueSeparator: ': ' stringifyValueFormatter: 'inspect' emojify: true colorify: true
tapDebug(message[, options])(object)
A curried tap()
able version of the debugger.
See above for a working example.
.debug(message[, object, options])
A ternary version of the curried tap()
able version of the debugger.
var see = ;see;
.ifElse(predicate, ifMessage, elseMessage[, options])(object)
A curried tap()
able version of the debugger, which will switch its message depending on whether the predicate
function supplied returns true
or false
on being called with the object
.
var see = ;// ...promise;
.switchCase(getCase, caseMessages[, options])(object)
A curried tap()
able version of the debugger, which can switch its message depending on whether the getCase
function supplied returns a key which matches a message in caseMessages
on being called with the object
.
var see = ;// ...promise;