diginext-utils
TypeScript icon, indicating that this package has built-in type declarations

3.12.7 • Public • Published

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()); // output some random name in English

// or

import { NameEN } from "diginext-utils/dist/name";
console.log(NameEN.generateName()); // output some random name in English

// or just
import { generateName } from "diginext-utils/dist/name/en";
console.log(generateName()); // output some random name in English

// or with require(...)
const xurl = require("../dist/string/url");
xurl.isLink("abc"); // FALSE
xurl.isLink("https://www.google.com"); // TRUE

Node module import:

IMPORTANT: Set "type" as "module" your package.json

// NodeJS moduies
import utils from "diginext-utils";
console.log(utils.xname.NameEN.generateName()); // output some random name in English
// browser
<script type="module">
	import { NameEN } from "diginext-utils/esm/name/index.js"; // ".js" file extension is required !
	console.log(NameEN.generateName()); // output some random name in English
</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
    • isValid
  • 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
    • makeSlug
  • color
    • random
    • pSBC
    • hexToRgb
    • hexDarken
    • hexLighten
    • RGBToHex
  • device
  • camera
    • requestCamera
    • requestDeviceOrientationControl
  • browser
    • isPotrait
    • isLandscape
    • ua
    • isFacebookWebview
    • isInAppWebview
  • Timer
    • wait
  • Validation
    • imageValidate
    • videoValidate

Dev

yarn dev

Support

Liên hệ TOP GROUP Developers nếu cần hỗ trợ.

Package Sidebar

Install

npm i diginext-utils

Weekly Downloads

261

Version

3.12.7

License

none

Unpacked Size

728 kB

Total Files

392

Last publish

Collaborators

  • tamlam
  • mrgoonie