Skip to content

Start

Installation

npm i @hedystia/useful
yarn add @hedystia/useful

Nodejs Version

  • v16.9.0 or higher

Example

Hedystia

Sections

Validations

FunctionDescription
isValidNumberCheck if it is a number
isEmptyStringCheck if the text is not empty
isValidUrlCheck that the text is a link
isValidEmailCheck if it is a email

Generators

FunctionDescription
generateCaptchaGenerates a random captcha string with the specified length
generateKeyGenerates a unique key with the specified prefix
generatePasswordGenerates a random password of the specified length

Colors

FunctionDescription
colorHashtagContains all hex colors starting with #
colorZeroContains all hex colors starting with 0x
listLogColorContains the colors for the log section

Utils

FunctionDescription
formatsDifferent types of text and number formats
    NumberFormats a number to a string with thousand separators
    TitleCaseFormats a string to title case
    SentenceCaseFormats a string to sentence case
    CamelCaseFormats a string to camel case
    KebabCaseFormats a string to kebab case
    SnakeCaseFormats a string to snake case
    DateForFormats a date as a string with a customizable order of day, month and year
millisecondConverts the indicated time to milliseconds
waitExecute the code after a while
logMake a log with or without color
typeCheck what type is provided
randomGet a random number between 2 numbers
randomItemGet a random element from an array
symbolsReturns a selected symbol