@moomfe/zenjs
v5.0.0-beta.5
Published
ZenJS 是一个高性能的 JavaScript 工具库。
Downloads
53
Maintainers
Readme
浏览器支持
| 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 | 57.01kb | 15.94kb | | | UMD | Browser | | zen.min.js | 20.42kb | 7.69kb | | | UMD | Browser | | zen.common.js | 53.12kb | 15.65kb | | | CommonJS | NodeJS or browserify or webpack 1 | | zen.esm.js | 53.11kb | 15.63kb | | | ES Module | webpack 2 or rollup |
Fat : Default And DOM API
| | Default | Gzip | - | Module | Use in | | :- | :- | :- | :-: | :- | :- | | zen.fat.js | 101.99kb | 27.36kb | | | UMD | Browser | | zen.fat.min.js | 36.36kb | 13.44kb | | | UMD | Browser | | zen.fat.common.js | 95.27kb | 26.90kb | | | CommonJS | NodeJS or browserify or webpack 1 | | zen.fat.esm.js | 95.25kb | 26.89kb | | | 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.