topu_utils
v1.2.14
Published
Utility has so many function that needed for every js developer.
Downloads
5
Maintainers
Readme
topu_utils
This utility package has everything you need to get started for javascript developers.
find in your package manager
npm install topu_utils
yarn add topu_utils
createSlug
import { createSlug } from 'topu_utils'
const slug = createSlug('youR teXt')
console.log(slug) // output: 'your-text'
| Function Name | type | instructions |
| ---------------- | ---------------------------- | ----------------------------------------------- |
| createSlug
| title: string
| Return slug using hypens with lowercase letters |
| isEmail
| email:string
| Validate email by regex |
| isPhone
| phone:string
| Validate US phone by regex |
| isText
| text:string
| Validate any String by regex |
| isNumber
| num:number
| Validate regular number by regex |
| sendDataToLS
| key:string
, data: object
| Send your precise data to local storage |
| getDataFromLS
| keyString:string
| Get local storage data |
| genRangeNumber
| min:number
, max: number
| Generate random number with min and max range |
| genString
| length:number
| Give length a number to generate random string |
| genNum
| length:number
| Give length a number to generate random number |
| genRandomPass
| length:number
| Generate random password based on length |
| replaceDot
| dotString:string
| Replace any dot to hypen |
| replaceHypen
| hypenString:string
| Replace any hypen to dot |
| tokenEncode
| dotString:string
| Replace dot to random given string |
| tokenDecode
| ranString:string
| Replace random string to dot |
| getWhatTimeAgo
| fullDate:string
| Return ago time according to the given date |