Skip to content
Because lodash didn't blow enough
Branch: master
Clone or download
Type Name Latest commit message Commit time
Failed to load latest commit information.
.travis.yml Add try-catch Jul 13, 2017 Add contributing and test runner Jul 6, 2017
LICENSE Initial commit Apr 24, 2017
_exceptions.js Fuck old versions of node Jul 13, 2017
index.js Add try-catch Jul 13, 2017
test.js Organize for travis Jul 6, 2017


Build Status We don't lie about our coverage

Why does this library exist? It's the satirical edition of the absolutely legendary library that is lodash.

the one true god

Using blodash allows you to liberate your code from nasty issues with using any sort of native features and tries to take all of the guesswork out of whether something truly exists or not. To put it simply, it's the last and only library you will ever need from hereon out.

Don't be fooled about using built in features of Javascript. You might not know when those features are going to be ripped out from under you and change. So you need a reliable callback based solution.

bLodash extensions


Evaluates your function or boolean and will decide to call your callback if it evaluates to true. If boolean evaluates as false an exception (b_.E.FalseIf) is thrown.

b_.if( function|boolean, callback );


Evaluates your if expression and catches the false exception and returns undefined.

b_.else( function|boolean, callback );


Evaluates your switch and catches any exception that may be thrown in your case statements. Throws an exception only if no statement is found with your value(default case).

//Where switched value is known at creation
b_.switch( function|value );

//When switch statement isn't known until later
b_.switch( function|value, callback );

b_.switch( ... )
    .eval( value, defaultCase );


        throw new Error()
        .catch(Error, function(){
            return true;

bLodash Example

Simple if

var a = true;
var value = b_.if( a, function(){
    return 'if-true';

// if-true

Exception Safe If:

Note, there is no way to return a value from an else. You must have a functional callback to be able to get values out of an else.

b_.else(function() {
    b_.if(function() {
        return b_.else(function() {
            b_.if(value, function() {
        }) === undefined;


Functional Switch:

Never have to worry about native switch again

        .case('case0', function(){
            return null; //Equivalent to break
        .case('case1', function(){
            return null;

var _switch = b_.switch();

for(var i = 0; i < 50; i++), function(){ console.log(i); });

// 5 6 7 8 9 10 11 ...


Never guess about what error is thrown again

        .catch(ReferenceError, function(){
            return true;
        .catch(Error, function(){
            return null

    try {
    } catch(e) {
        if(e instanceof ReferenceError){
            return true;
        } else {
            return null;
You can’t perform that action at this time.