JSPM

  • Created
  • Published
  • Downloads 574
  • Score
    100M100P100Q95724F
  • 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

使用

  <script src="zen.min.js"></script>

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


大小 - 版本详解

Default Gzip - Module Use in
zen.js 44.56kb 11.66kb | UMD Browser
zen.min.js 16.61kb 6.37kb | UMD Browser
zen.common.js 41.41kb 11.44kb | CommonJS NodeJS or browserify or webpack 1
zen.esm.js 41.40kb 11.42kb | ES Module webpack 2 or rollup

参考

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

  • Array

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

    • $add
    • $concat
    • $delete
    • $deleteValue
    • $each
    • $equals
    • $get
    • $inArray
    • $set
    • $push
    • $unshift
    • $pop
    • $shift
  • document

    • $ready
    • $query
    • $queryFirst
  • Element.prototype

    • _index
    • $addClass
    • $removeClass
    • $hasClass
    • $toggleClass
    • $child
    • $children
    • $first
    • $firstChild
    • $last
    • $lastChild
    • $is
    • $not
    • $query
    • $queryFirst
    • $parent
    • $parents
    • $next
    • $prev
    • $nextAll
    • $prevAll
    • $siblings
    • $selectText
  • EventTarget.prototype

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

    • $mean
    • $random
    • $randomPlus
  • Number

    • $isNumber
  • Object

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

    • $delete
    • $deleteValue
    • $get
    • $set
    • $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