commonkitjs
v1.1.6
Published
Commonkit - a multipurpose npm package
Downloads
2
Readme
Commonkitjs
What commonkit js can do ~
- Can remove html / mark-down from string
- Can generate numbers (as much as you want)
- Can check object in an array
- Can check object by its id
- Can give you random message from an array
- Can remove Url from a given string
- Can generate number
- add more soon...
Installation
Commonkitjs requires Node.js v10+ to run.
Install now.
npm i commonkitjs@latest
Start using commonkit
const kit = require('commonkitjs');
const commonkit = new kit.Commonkit({active: true});
Generate Random Color
let genColor = commonkit.colorGenerator();
console.log(genColor);
Generate Random Number
let genNumber = commonkit.generateNumber(10);
console.log(genNumber);
Generate Random String
let genString = commonkit.generateString(8);
console.log(genString);
Check an object in a array
let myArray = ["common", "uncommon", "commonkit"];
let checkArr = commonkit.checkArray(myArray, "commonkit")
console.log(checkArr);
//output: true
Return random object from an array
let myArray = ["hi buddy", "hello friend", "how are you?"];
let checkArr = commonkit.getRandomMessage(myArray)
console.log(checkArr);
//output (random): hello friend