omg-like-literally
v0.1.0
Published
omg like literally
Downloads
3
Readme
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.
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);