JSPM

  • Created
  • Published
  • Downloads 574
  • Score
    100M100P100Q95689F
  • 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+ 9+

安装

npm 安装

  npm install @moomfe/zenjs

CDN

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

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


大小 - 版本详解

Default

Default Gzip - Module Use in
zen.js 61.37kb 16.18kb | UMD Browser
zen.min.js 22.29kb 8.37kb | UMD Browser
zen.common.js 57.05kb 15.88kb | CommonJS NodeJS or browserify or webpack 1
zen.esm.js 57.04kb 15.87kb | ES Module webpack 2 or rollup

Slim : No DOM API

Default Gzip - Module Use in
zen.slim.js 29.66kb 8.24kb | UMD Browser
zen.slim.min.js 10.96kb 4.27kb | UMD Browser
zen.common.slim.js 27.43kb 8.05kb | CommonJS NodeJS or browserify or webpack 1
zen.esm.slim.js 27.42kb 8.04kb | ES Module webpack 2 or rollup

参考

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

  • Array

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

    • $add
    • $concat
    • $concatTo
    • $delete / $remove
    • $deleteValue / $removeValue
    • $each
    • $equals
    • $get
    • $inArray
    • $find
    • $findIndex
    • $set / $edit
    • $move
    • $moveRange
    • $push
    • $unshift
    • $pop
    • $shift
  • document

    • $cookie
    • $deleteCookie / $removeCookie
    • $id
    • $ready
    • $query
    • $queryFirst
  • Element.prototype

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

    • $data
    • $hasData
    • $deleteData / $removeData
    • $on
    • $one / $once
    • $off
    • $emit
  • Math

    • $plus / $jia
    • $minus / $jian
    • $multiply / $cheng
    • $divide / $chu
    • $mean
    • $random
    • $randomPlus
  • Number

    • $isNumber
  • Object

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

    • $delete / $remove
    • $deleteValue / $removeValue
    • $get
    • $set / $edit
    • $self
    • __self__
  • String

    • $random
    • $someRandom
  • String.prototype

    • $toCapitalize
    • $replaceAll
  • window

    • $ready
    • $typeof
    • $querystring.stringify
    • $querystring.parse

在本地构建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.