grafith-is

1.1.0 • Public • Published

Description

This is a lib to know if a number is even. (is a joke with the brazilian band: Grafith)

Usage

const is = require('grafith-is');
 
is(3);

Result:

Você chupa

If you need a customizable result:

const is = require('grafith-is');
 
is(3, odd_fn, even_fn('params'));
 
function odd_fn() {
    console.log('own function');
}
 
function even_fn(parameter) {
    console.log(`own function with ${parameter}`);
}

API

is(value, odd, even)

Parameter Type Value
value number any number
odd function a custom function if the number is odd
even function a custom function if the number is even

Dependencies (0)

    Dev Dependencies (1)

    Package Sidebar

    Install

    npm i grafith-is

    Weekly Downloads

    3

    Version

    1.1.0

    License

    MIT

    Last publish

    Collaborators

    • john-luc