包详细信息

eigen-utils

wxz14MIT不推荐使用1.1.0

Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

common util tool functions for frontend.

utils, eigen

自述文件

eigen-utils

Common util tool functions for frontend.

Installation

npm install eigen-utils --save 
yarn add eigen-utils

Usage

import eigen from "eigen-utils"

eigen.md5("eigen")
eigen.isAlpha()

or

import { md5, isAlpha } from "eigen-utils"
md5("eigen")
isAlpha()

Tool functions

  • getAvatar() get user avatar url (eigen use only)
  • getCookie(name) get cookie
  • getRealname() get current user realname (eigen use only)
  • getUsername() get current user username (eigen use only)
  • isAlpha() judge current env is alpha or production (same to isDevMode())(eigen use only)
  • md5(str, bit) md5 string
  • hash(str) hash a string to number
  • uuid(len, radix) generate uuid
  • debounce(func, wait, immediate) function debounce
  • throttle(func, wait, options) function throttle
  • deepClone(object) object deepclone
  • type(variable) judge variable type
  • base64() encode and deconde string
  • isJSON(variable) judge variable is JSON

Recommand Usage

import md5 from "eigen-utils/md5"
md5("eigen")