JSPM

  • Created
  • Published
  • Downloads 679
  • Score
    100M100P100Q95812F
  • License MIT

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

Package Exports

  • @moomfe/zenjs

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@moomfe/zenjs) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

ZenJS

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



浏览器支持

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

安装

npm 安装

  npm install @moomfe/zenjs

CDN

  <!-- jsdelivr -->
  <script src="https://cdn.jsdelivr.net/npm/@moomfe/zenjs@3.1.2/dist/zen.min.js"></script>
  <!-- unpkg -->
  <script src="https://unpkg.com/@moomfe/zenjs@3.1.2/dist/zen.min.js"></script>

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


大小 - 版本详解

Default

Default Gzip - Module Use in
zen.js 53.65kb 14.84kb | UMD Browser
zen.min.js 19.36kb 7.11kb | UMD Browser
zen.common.js 49.92kb 14.57kb | CommonJS NodeJS or browserify or webpack 1
zen.esm.js 49.91kb 14.55kb | ES Module webpack 2 or rollup

Fat : Default And DOM API

Default Gzip - Module Use in
zen.fat.js 83.93kb 22.33kb | UMD Browser
zen.fat.min.js 29.88kb 10.82kb | UMD Browser
zen.fat.common.js 78.28kb 21.94kb | CommonJS NodeJS or browserify or webpack 1
zen.fat.esm.js 78.27kb 21.93kb | ES Module webpack 2 or rollup

参考

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

  • Array

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

    • $chunk
    • $each
    • $equals
    • $add
    • $delete / $remove
    • $deleteValue / $removeValue
    • $concat
    • $concatTo
    • $find
    • $findIndex
    • $findLast
    • $findLastIndex
    • $findAll
    • $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
  • Date

    • $parse
  • Date.prototype

    • $dayjs
    • $isValid
    • $year
    • $month
    • $date
    • $day
    • $hour
    • $minute
    • $second
    • $millisecond
    • $set
    • $add
    • $subtract
    • $startOf
    • $endOf
    • $format
    • $diff
    • $daysInMonth
    • $toArray
    • $toObject
    • $isBefore
    • $isSame
    • $isAfter
  • Window / Global

    • $typeof
    • $querystring
      • stringify
      • parse
  • Document ( Fat )

    • $id
    • $ready
  • Window ( Fat )

    • $ready
  • Element.prototype ( Fat )

    • $addClass
    • $removeClass / $deleteClass
    • $hasClass
    • $toggleClass
    • $is
    • $not
    • $first / $firstChild
    • $last / $lastChild
    • $next
    • $prev
    • $nextAll
    • $prevAll
    • $child / $children
    • $parent
    • $parents
    • $siblings
    • $append
    • $prepend
    • $appendTo
    • $prependTo
    • $before
    • $after
    • $delete / $remove
    • $query / $find
    • $queryFirst / $findFirst
    • $replaceWith / $replace
    • _nodeName
    • _index
    • _width
    • _height
    • _html
    • _val / _value
  • EventTarget.prototype ( Fat )

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

    • $cookie
    • $deleteCookie / $removeCookie

在本地构建ZenJS

克隆到本地:

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

安装依赖项:

cd ZenJS && npm install

构建项目:

npm run build

实时监听项目修改:

npm run watch

License

ZenJS is licensed under a MIT License.