JavaScript 函数库、工具类
## Browser Support
![IE](https://raw.github.com/alrra/browser-logos/master/src/archive/internet-explorer_7-8/internet-explorer_7-8_48x48.png) | ![Edge](https://raw.github.com/alrra/browser-logos/master/src/edge/edge_48x48.png) | ![Chrome](https://raw.github.com/alrra/browser-logos/master/src/chrome/chrome_48x48.png) | ![Firefox](https://raw.github.com/alrra/browser-logos/master/src/firefox/firefox_48x48.png) | ![Opera](https://raw.github.com/alrra/browser-logos/master/src/opera/opera_48x48.png) | ![Safari](https://raw.github.com/alrra/browser-logos/master/src/safari/safari_48x48.png)
--- | --- | --- | --- | --- | --- |
7+ ✔ | Latest ✔ | Latest ✔ | Latest ✔ | Latest ✔ | 6+ ✔ |
## Docs
[To view the document](https://x-extends.github.io/xe-utils/) [查看文档](https://vxetable.cn/xe-utils)
## Installing
```shell
npm install xe-utils
```
Using nodejs
```javascript
const XEUtils = require('xe-utils')
```
Get on [unpkg](https://unpkg.com/xe-utils/) and [cdnjs](https://cdn.jsdelivr.net/npm/xe-utils/)
```HTML
<script src="https://cdn.jsdelivr.net/npm/xe-utils"></script>
```
### Import all methods
```javascript
import _XEUtils_ from 'xe-utils'
XEUtils.toDateString(Date.now())
// 2018-01-01 10:30:28
XEUtils.toStringDate('2018-01-01 10:30:00')
// Mon Jan 01 2018 10:30:00 GMT+0800 (中国标准时间)
```
## Import on demand
这样按需引入方法,可以使体积达到最小
单个导入,包的大小 gzip >≈ 60B+,按需导入
```javascript
import each from 'xe-utils/each'
import toDateString from 'xe-utils/toDateString'
each({ a: 11, b: 22, c: 33 }, function (item, key){
console.log(item)
})
// 11
// 22
// 33
toDateString(Date.now(), 'yyyy-MM-dd HH:mm:ss')
// 2018-01-01 10:30:28
```
```javascript
import XEUtils from 'xe-utils/ctor'
import each from 'xe-utils/each'
import toDateString from 'xe-utils/toDateString'
import toFixedNumber from 'xe-utils/toFixedNumber'
XEUtils.mixin({
each,
toDateString,
toFixedNumber
})
XEUtils.toDateString(Date.now(), 'yyyy-MM-dd HH:mm:ss')
// 2018-01-01 10:30:28
```
按功能导入所有方法
```javascript
import XEUtils from 'xe-utils/ctor'
import objectMethods from 'xe-utils/object'
import arrayMethods from 'xe-utils/array'
import baseMethods from 'xe-utils/base'
import numberMethods from 'xe-utils/number'
import dateMethods from 'xe-utils/date'
import stringMethods from 'xe-utils/string'
import functionMethods from 'xe-utils/function'
import urlMethods from 'xe-utils/url'
import webMethods from 'xe-utils/web'
XEUtils.mixin(
// Object
objectMethods,
// Array
arrayMethods,
// Base
baseMethods,
// Number
numberMethods,
// Date
dateMethods,
// String
stringMethods,
// Function
functionMethods,
// URL
urlMethods,
// Web
webMethods
)
```
没有合适的资源?快使用搜索试试~ 我知道了~
JavaScript 函数库、工具类.zip
共458个文件
js:247个
ts:189个
md:4个
需积分: 5 0 下载量 111 浏览量
2024-02-06
09:34:31
上传
评论
收藏 602KB ZIP 举报
温馨提示
JavaScript 函数库、工具类.zip
资源推荐
资源详情
资源评论
收起资源包目录
JavaScript 函数库、工具类.zip (458个子文件)
app.9ba25d12.css 2KB
chunk-vendors.42851454.css 763B
.editorconfig 121B
.eslintrc 58B
index.html 2KB
index.html 2KB
favicon.ico 17KB
favicon.ico 17KB
chunk-vendors.81bac7f4.js 1007KB
app.91366294.js 92KB
base.test.js 62KB
date.test.js 55KB
array.test.js 48KB
number.test.js 26KB
string.test.js 24KB
index.js 10KB
toDateString.js 5KB
locat.test.js 5KB
toStringDate.js 5KB
cookie.js 5KB
base.js 4KB
object.test.js 3KB
orderBy.js 3KB
set.js 2KB
array.js 2KB
toArrayTree.js 2KB
getWhatWeek.js 2KB
kebabCase.js 2KB
browse.js 2KB
toNumberString.js 2KB
getWhatMonth.js 2KB
searchTree.js 2KB
clone.js 2KB
camelCase.js 2KB
function.test.js 2KB
parseUrl.js 2KB
getDateDiff.js 2KB
helperEqualCompare.js 1KB
has.js 1KB
debounce.js 1KB
throttle.js 1KB
get.js 1KB
copyWithin.js 1KB
commafy.js 1KB
remove.js 1KB
static.js 1KB
clear.js 1KB
serialize.js 1KB
date.js 1KB
getWhatYear.js 1KB
findTree.js 1KB
helperCreateGetDateWeek.js 1KB
getWhatDay.js 1KB
assign.js 1KB
invoke.js 1KB
reduce.js 1KB
groupBy.js 1KB
getWhatQuarter.js 1KB
mapTree.js 1KB
string.js 1006B
helperCreateIterateHandle.js 985B
number.js 930B
eachTree.js 922B
helperCreateMathNumber.js 921B
padStart.js 909B
padEnd.js 901B
toTreeArray.js 892B
toFixed.js 887B
helperCreatePickOmit.js 866B
merge.js 841B
getDayOfMonth.js 828B
uniq.js 802B
isEqualWith.js 800B
isMatch.js 791B
subtract.js 779B
slice.js 745B
sum.js 721B
destructuring.js 707B
ctor.js 703B
objectMap.js 694B
helperCreateMinMax.js 688B
chunk.js 673B
filterTree.js 658B
helperNumberDivide.js 655B
getYearDay.js 649B
getType.js 642B
helperCreateiterateIndexOf.js 632B
forOf.js 623B
lastForOf.js 605B
after.js 581B
findLast.js 579B
before.js 578B
helperCreateIndexOf.js 570B
findLastIndexOf.js 567B
includeArrays.js 559B
once.js 558B
getDayOfYear.js 555B
map.js 553B
flatten.js 553B
filter.js 551B
共 458 条
- 1
- 2
- 3
- 4
- 5
资源评论
YOLO数据集工作室
- 粉丝: 475
- 资源: 1568
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功