@cycjimmy/awesome-js-funcs

Personal collection of javascript functions often used.


Keywords
collection, javascript, function
License
MIT
Install
npm install @cycjimmy/awesome-js-funcs@1.1.1

Documentation

Awesome Js Funcs

libraries dependency status libraries sourcerank Release date semantic-release npm license

Install

NPM version NPM bundle size npm download

# via npm
$ npm install @cycjimmy/awesome-js-funcs --save

# or via yarn
$ yarn add @cycjimmy/awesome-js-funcs

Usage. E.g:

import { isString } from '@cycjimmy/awesome-js-funcs';

// or better import
import { isString } from '@cycjimmy/awesome-js-funcs/esm/judgeBasic';

// or best import (recommend)
import isString from '@cycjimmy/awesome-js-funcs/esm/judgeBasic/isString';
const isString = require('@cycjimmy/awesome-js-funcs/cjs/judgeBasic/isString.cjs').default;

console.log(isString('string'));   // show true

Function Collection

  • judgeBasic
    • isString
    • isNumber
    • isObject
    • isFunction
    • isArray
    • isNull
    • isUndefined
    • isPromise
    • isNodeList
    • isUrl
  • judge
    • isChineseName
    • isChinesePhoneNumber
    • isChineseIdentificationNum
  • string
    • trim
    • firstUpperCase
    • midlineToCamel
  • array
    • shuffle
  • object
    • entries
    • clean
  • math
    • randomInt
  • typeConversion
    • nodeListToArray
    • functionToPromise
    • stringTrueFalseToBoolean
    • stringToJson
  • dom
    • QueryAll (constructor)
    • siblingFilter
    • addStyles
    • getElementStyle
    • addPreloadLink
    • touchActive
    • touchActiveMockClick
  • event
    • dispatch
    • debounce
    • throttle
    • preventDefault
  • media
    • isAudioPlaying
    • isVideoPlaying
  • handheld
    • judgeOrientation
    • isMobile
    • getBrowserInfo
  • function
    • delayForPromise
  • regExpression
    • chineseName
    • chinesePhoneNumber
    • chineseIdentificationNum
  • designPattern
    • CreateInstance (constructor)
  • seldom
    • getUrlRelativeDir