Skip to content
This repository has been archived by the owner on Dec 15, 2021. It is now read-only.
/ ZenJS Public archive

ZenJS 是一个高性能的 JavaScript 工具库。

License

Notifications You must be signed in to change notification settings

MoomFE/ZenJS

Repository files navigation

ZenJS

ZenJS 是一个高性能的 JavaScript 工具库。



浏览器支持

Chrome Firefox Safari Android Edge Internet Explorer
23+ 21+ 6+ 4.4+ 12+ 10+

安装

npm 安装

  npm install @moomfe/zenjs

CDN

jsdelivr
https://cdn.jsdelivr.net/npm/@moomfe/[email protected]/dist/

unpkg
https://unpkg.com/@moomfe/[email protected]/dist/


在 v2.1.0 版本之前, ZenJS 需要 polyfill 作为依赖项 :


大小 - 版本详解

Default

Default Gzip - Module Use in
zen.js 56.70kb 15.98kb | UMD Browser
zen.min.js 20.26kb 7.64kb | UMD Browser
zen.common.js 52.83kb 15.58kb | CommonJS NodeJS or browserify or webpack 1
zen.esm.js 52.82kb 15.57kb | ES Module webpack 2 or rollup

Fat : Default And DOM API

Default Gzip - Module Use in
zen.fat.js 101.65kb 27.38kb | UMD Browser
zen.fat.min.js 36.19kb 13.39kb | UMD Browser
zen.fat.common.js 94.96kb 26.84kb | CommonJS NodeJS or browserify or webpack 1
zen.fat.esm.js 94.94kb 26.83kb | ES Module webpack 2 or rollup

参考

更详细的使用方法及介绍请参照 index.d.ts

  • Array

    • $chunk
    • $copy
    • $create
    • $create
    • $each
    • $equals
    • $isArrayLike
    • $toArray
  • Array.prototype

    • $chunk
    • $each
    • $equals
    • $add
    • $delete / $remove
    • $deleteValue / $removeValue
    • $concat
    • $concatTo
    • $find
    • $findIndex
    • $findChunk
    • $findLast
    • $findLastIndex
    • $findLastChunk
    • $findAll
    • $findAllIndex
    • $findAllChunk
    • $findSome
    • $findSomeIndex
    • $findSomeChunk
    • $findLastSome
    • $findLastSomeIndex
    • $findLastSomeChunk
    • $findNot
    • $findNotIndex
    • $findNotChunk
    • $findLastNot
    • $findLastNotIndex
    • $findLastNotChunk
    • $findAllNot
    • $findAllNotIndex
    • $findAllNotChunk
    • $findSomeNot
    • $findSomeNotIndex
    • $findSomeNotChunk
    • $findLastSomeNot
    • $findLastSomeNotIndex
    • $findLastSomeNotChunk
    • $get
    • $set
    • $edit
    • $inArray
    • $move
    • $moveRange
    • $push
    • $pop
    • $unshift
    • $shift
    • $splice
  • Object

    • $assign
    • $equals
    • $each
    • $isEmptyObject
    • $isPlainObject
  • Object.prototype

    • $assign
    • $equals
    • $each
    • $get
    • $set / $edit
    • $delete / $remove
    • $deleteValue / $removeValue
    • $self
  • Number

    • $isNumber
  • Number.prototype

    • $add / $jia
    • $subtract / $jian
    • $multiply / $cheng
    • $divide / $chu
  • Math

    • $random
    • $add / $jia
    • $subtract / $jian
    • $multiply / $cheng
    • $divide / $chu
    • $mean
  • String

    • $random
    • $someRandom
  • String.prototype

    • $replaceAll
    • $toCapitalize / $toUpperFirstCase
    • $toLowerFirstCase
  • Date

    • $parse
    • $format
    • $year
    • $month
    • $date
    • $day
    • $hour
    • $minute
    • $second
    • $millisecond
    • $set
    • $add
    • $subtract
    • $startOf
    • $endOf
    • $diff
    • $valueOf
    • $unix
    • $daysInMonth
    • $toArray
    • $toObject
    • $isBefore
    • $isSame
    • $isAfter
    • $isBetween
    • $isSameOrBefore
    • $isSameOrAfter
    • $isLeapYear
  • Date.prototype

    • $dayjs
    • $isValid
    • $year
    • $month
    • $date
    • $day
    • $hour
    • $minute
    • $second
    • $millisecond
    • $set
    • $add
    • $subtract
    • $startOf
    • $endOf
    • $format
    • $diff
    • $valueOf
    • $unix
    • $daysInMonth
    • $toArray
    • $toObject
    • $isBefore
    • $isSame
    • $isAfter
    • $isBetween
    • $isSameOrBefore
    • $isSameOrAfter
    • $isLeapYear
  • Function.prototype

    • $after
    • $args
    • $one / $once
  • RegExp

    • $parse
  • Window / Global

    • $typeof
    • $querystring
      • stringify
      • parse
    • ZenJS
      • guid
      • assign
      • repeat
      • keys
      • entries
      • values
      • fromEntries
      • congruence
      • equals
      • define
      • defineValue
      • defineGet
      • intRandom
      • returnArg
      • returnTrue
      • returnFalse
      • noop
      • parametersDefault
      • parametersRest
      • isString
      • isBoolean
      • isArray
      • isNumber
      • isRegExp
      • isSet
      • isMap
      • isFunction
      • isObject
      • isReferenceType
      • mapSetToArray
    • dayjs
  • Document ( Fat )

    • $id
    • $ready
    • $query / $find
    • $queryFirst / $findFirst
  • Window ( Fat )

    • $ready
  • Location ( Fat )

    • $search
    • $urlSearch
  • Element.prototype ( Fat )

    • $addClass
    • $removeClass / $deleteClass
    • $hasClass
    • $toggleClass
    • $is
    • $not
    • $first / $firstChild
    • $last / $lastChild
    • $next
    • $prev
    • $nextAll
    • $prevAll
    • $child / $children
    • $parent
    • $parents
    • $siblings
    • $prop
    • $hasProp
    • $removeProp / $deleteProp
    • $attr
    • $hasAttr
    • $removeAttr / $deleteAttr
    • $append
    • $prepend
    • $appendTo
    • $prependTo
    • $before
    • $after
    • $delete / $remove
    • $query / $find
    • $queryFirst / $findFirst
    • $replaceWith / $replace
    • $clone
    • $index
    • $html
    • $val / $value
    • $width
    • $height
    • $css
    • _nodeName
  • EventTarget.prototype ( Fat )

    • $data
    • $hasData
    • $removeData/ $deleteData
    • $on
    • $one / $once
    • $off
    • $emit
  • document ( Plugins )

    • $cookie
    • $removeCookie / $deleteCookie

在本地构建ZenJS

克隆到本地:

git clone https://github.com/MoomFE/ZenJS.git

安装依赖项:

cd ZenJS && npm install

构建项目:

npm run build

实时监听项目修改:

npm run watch

Include


License

ZenJS is licensed under a MIT License.