The library of utility plugins
Exports
- "diginext-utils/dist": ES6 modules / NodeJS
- "diginext-utils/esm": Node modules / JavaScript modules
Imports
ES5 module import:
import utils from "diginext-utils";
console.log(utils.xname.NameEN.generateName());
import { NameEN } from "diginext-utils/dist/name";
console.log(NameEN.generateName());
import { generateName } from "diginext-utils/dist/name/en";
console.log(generateName());
const xurl = require("../dist/string/url");
xurl.isLink("abc");
xurl.isLink("https://www.google.com");
Node module import:
IMPORTANT: Set "type" as "module" your package.json
import utils from "diginext-utils";
console.log(utils.xname.NameEN.generateName());
// browser
<script type="module">
import { NameEN } from "diginext-utils/esm/name/index.js";
console.log(NameEN.generateName());
</script>
Features
- xconsole
- xarray
- sumArray
- averageArray
- minArray
- maxArray
- sortElementByString
- sortElementByNumber
- firstElement
- lastElement
- randomIndex
- randomElement
- mergeAndMakeUniqueElement
- allMatchInArray
- removeItem
- removeItemByKey
- getRandom
- getHalfRandom
- shuffle
- moveIndex
- moveArray
- xmath
- rand
- randRound
- randHalt
- randInt
- randFloat
- degToRad
- radToDeg
- angleBetweenPoints
- diffDate
- positiveNumber
- xname
- NameEN.generateName()
- NameVI.generateName()
- xobject
- isNull
- toBool
- toInt
- toFloat
- toArray
- objectToArray
- xjson
- xfile
- createDir
- fileMove
- findFileByExt
- xstring
- getBetween
- makeString
- toUpperCase
- toLowerCase
- titleize
- capitalize
- capitalizeName
- clearUnicodeCharacters
- generateUUID
- randAllCharacterByLength
- randomStringByLength
- formatNumber
- generatePassword
- trimNull
- addQueryParam
- getUrlParams
- isLink
- getFileNameWithoutExtension
- getFileNameWithExtension
- getFileExtension
- isImage
- xurl
- addQueryParam
- getUrlParams
- isLink
- getFileNameWithoutExtension
- getFileNameWithExtension
- getFileExtension
- isImage
- slug
- color
- random
- pSBC
- hexToRgb
- hexDarken
- hexLighten
- RGBToHex
- device
- camera
- requestCamera
- requestDeviceOrientationControl
- browser
- isPotrait
- isLandscape
- ua
- isFacebookWebview
- isInAppWebview
- Timer
- Validation
- imageValidate
- videoValidate
Dev
yarn dev
Support
Liên hệ TOP GROUP Developers nếu cần hỗ trợ.