an npm package for small things that im lazy to add in every project i have
Read a .json file and return it's parsed data.
Write data to a .json file.
Promisified version of "setTimeout()" for waiting a certain amount of milliseconds before executing the next line of code.
Limit a string's length to a certain number of characters.
If string length is less than specified in "limit", returns the string itself. Otherwise returns string with the limited length.
const string = 'Subscribe to technoblade'; // 24 characters long
console.log(limit(string, 20)); // 'Subscribe to techno…' ("…" is 1 character)
Get a pseudo-random number between "min" and "max" numbers. Includes both "min" and "max" numbers. Supports negative numbers.
Returns a number between "min" and "max" values.
console.log(getRandomArbitrary(69, 420)); // 243
console.log(getRandomArbitrary(-1337, 1337)); // -462
Get a pseudo-random number in a range from 0 to "num". Supports negative values.
If "num" > 0, returns a random number between 0 and "num". Otherwise returns a random negative number between "num" and 0.
console.log(getRandomInt(-300)) // -229
console.log(getRandomInt(1337)) // 592
An object that consists of english letters and numbers.