Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

grafith-is

John-Luke13MIT1.1.0

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

grafith, even, odd, par, impar, ímpar

readme

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