0.2.3 • Published 3 years ago
@bisaek/is v0.2.3
is wiki
install:
npm i @bisaek/is
or:
npm install @bisaek/is
reqiure is
const { isConfig, is } = require("is");
code example
with is
:
if (is.month("december") || is.month("january") || is.month("february")) {
console.log("its cold outside");
}
without is
:
let myDate = new Date();
if (
myDate.getMonth() === 11 ||
myDate.getMonth() === 0 ||
myDate.getMonth() === 1
) {
console.log("its cold outside");
}
with is
its better because its more readable, and less. in is
can you use string and int to write the month.
example:
isConfig.month.jan = 0;
console.log(is.month("january"), "jan");
console.log(is.month(0), "jan");
console:
>node example.js
true
true