0.1.0 • Published 8 years ago
omg-like-literally v0.1.0
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-literallyUsage
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);0.1.0
8 years ago