What is Funcly?
Funcly is a basic package. It is my first ever NPM package, so do not expect anything too complicated :)
Installation
npm i --save funcly
Funcly's functions
CONSOLE STYLING
- log(thingToLog); - Logs thingToLog to the console
- red(thingToLog); - Logs thingToLog with red text to the console
- blue(thingToLog); - Logs thingToLog with red text to the console
- yellow(thingToLog); - Logs thingToLog with yellow text to the console
- green(thingToLog); - Logs thingToLog with green text to the console
- cyan(thingToLog); - Logs thingToLog with cyan text to the console
- magenta(thingToLog); - Logs thingToLog with magenta text to the console
- bold(thingToLog); - Logs thingToLog with bold text to the console
- italic(thingToLog); - Logs thingToLog with italic text to the console
- underline(thingToLog); - Logs thingToLog with underlined text to the console
MISC FUNCTIONS
- random(from|number, to|number) - Returns a random number between the from and to arguments
- rndArray(array|array) - Returns a random item from the specified array.
- sleep(timeInMs|number) - Waits timeInMs milliseconds.
- delay(timeInMs|number) - Same thing as above.
- genString(length|number, allowSpecial|boolean, allowNumbers|boolean) - Generates a string with a length of the specified length. If allowSpecial is set to false, the string will not have any special characters in it. If allowNumbers is set to false, the special characters will not have any number in it.
- genHex() - Generates a random HEX color.
- toCelsius(degrees|number, startingUnit|string
(available starting units are: kelvin, celsius and fahrenheit)
) - Converts the degrees argument from the startingUnit argument to Celsius. - toFahrenheit(degrees|number, startingUnit|string
(available starting units are: kelvin, celsius and fahrenheit)
) - Converts the degrees argument from the startingUnit argument to Fahrenheit. - toKelvin(degrees|number, startingUnit|string
(available starting units are: kelvin, celsius and fahrenheit)
) - Converts the degrees argument from the startingUnit argument to Kelvin.