omg-like-literally

0.1.0 • Public • Published

omg-like-literally

A powerful utility library that gives you the ability to express your code with the poise, intelligence, and brevity of a San Fernando Valley girl.

Dependencies Build Status Build status Coverage Status MIT licensed

Installation

npm install omg-like-literally

Usage

const omgLikeLiterally = require('omg-like-literally');

barf me out!

Throws an Error. You can optionally pass a message, but it contains a default.

const yourFunction (bod) {
    if (!bod) {
        omgLikeLiterally.barfMeOut('missing bod');
    }
};

can't even!

Returns a random number. Guaranteed to be odd.

const oddNumber = omgLikeLiterally.cantEven();

dying!

Exits the process with status code 1. Useful when your code is falling over like a hot mess and you're literally dying.

omgLikeLiterally.dying();

even!

Returns a random number. Guaranteed to be even.

const evenNumber = omgLikeLiterally.even();

gag me with a spoon!

Functionally equivalent to barf me out, with a different error message.

const yourFunction (bod) {
    if (!bod) {
        omgLikeLiterally.gagMeWithASpoon('missing bod');
    }
};

no duh!

Returns true.

const fnReturnsTrue () {
    return omgLikeLiterally.noDuh;
};

psych!

Returns false.

const fnReturnsFalse () {
    return omgLikeLiterally.psych;
};

take a chill pill!

Attempts to execute a given function and return its result. If an error is thrown, it returns the error instead.

let returnValueOrError = omgLikeLiterally.takeAChillPill(yourVolatileOperation);

Readme

Keywords

Package Sidebar

Install

npm i omg-like-literally

Weekly Downloads

0

Version

0.1.0

License

MIT

Unpacked Size

9.14 kB

Total Files

24

Last publish

Collaborators

  • codearoni