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:23+
- Edge:12+
- Firefox:21+
- Internet Explorer:9+
- Safari:6+
- Android: 4.4+
大小 - 版本详解
Default | Gzip | - | Module | Use in | |
---|---|---|---|---|---|
zen.js | 34.49kb | 8.79kb | | | UMD | Browser |
zen.min.js | 11.66kb | 4.65kb | | | UMD | Browser |
zen.common.js | 31.95kb | 8.61kb | | | CommonJS | NodeJS or browserify or webpack 1 |
zen.esm.js | 31.94kb | 8.59kb | | | ES Module | webpack 2 or rollup |
使用
ZenJS 使用了最新的语法与方法,语法使用 babel 进行转义,polyfill 则需要自行添加。
<script src="--- Include your polyfill ---"></script>
<script src="Zen.min.js"></script>
参考
更详细的使用方法及介绍请参照 index.d.ts
Array
- $create
Array.prototype
- $add
- $delete
- $deleteValue
- $equals
- $get
- $inArray
- $set
- $push
- $unshift
- $pop
- $shift
document
- $ready
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