1.0.3-alpha.1 • Published 3 years ago
@seryibaran/useuseful v1.0.3-alpha.1
useUseful.js - ESM module with useful JavaScript functions!
Install
npm i @seryibaran/useusefulOR
yarn add @seryibaran/useusefulList of functions
Template:
UXxx- description of modulexxx- description of module.module- ...
xxx- description of functionxxx- description of argument
- ...
URandom- random functionsint- generates random number in range.min- minimummax- maximum
float- generates random float number in range.min- minimummax- maximum
bool- generates random bool (true/false)choose- returns random element from array.array- array for choose
arrOfNumbers- generates array, filled with random numbers in range.len- length of generated arraymin- minimummax- maximum
UMath- math functionspi- returns the number pi with the specified number of decimal places.len- number of decimal places
UTime- time functionssleep- returns a promise that will be resolved after the specified time in milliseconds.time- time of sleep in milliseconds
UArray- array functionscount- functions for countingnumbersfunctions for counting numbersodd- returns the number of odd numbersarray- array for counting
even- returns the number of even numbersarray- array for counting
positive- returns the number of positive numbersarray- array for counting
negative- returns the number of negative numbersarray- array for counting
includes- functions for countingnumbersfunctions for counting numbersodd- tests an array for includes of odd numbersarray- array for test
even- tests an array for includes of even numbersarray- array for test
positive- tests an array for includes of positive numbersarray- array for test
negative- tests an array for includes of negative numbersarray- array for test
UConvert- functions for convertrgbToHex- convert RGB to HEXr- redg- greenb- blue
celsiusToFahrenheit- convert celsius to fahrenheitcelsius- temperature in celsius
fahrenheitToCelsius- convert fahrenheit to celsiusfahrenheit- temperature in fahrenheit
UObject- objects functionscopy- returns a full copy of the objectobj- object for copying
Example of using
Import module:
import { UMath } from "@seryibaran/useuseful";Run function:
console.log(UMath.pi(5)); // Prints "3.14159"1.0.3-alpha.1
3 years ago
1.0.2
3 years ago
1.0.2-alpha.8
3 years ago
1.0.2-alpha.7
3 years ago
1.0.2-alpha.6
3 years ago
1.0.2-alpha.5
3 years ago
1.0.2-alpha.4
3 years ago
1.0.2-alpha.3
3 years ago
1.0.2-alpha.1
3 years ago
1.0.1
3 years ago
1.0.0
3 years ago
