1.0.8 • Published 3 years ago

itool v1.0.8

Weekly downloads
1
License
ISC
Repository
github
Last release
3 years ago

i-tools# 介绍

通用函数工具库

安装

npm install itool

导入

import { formatTime, htmlEscape,htmlUnEscape,formatMoney } form 'itool'

格式化时间

//时间格式化
const time = new Date()

const formatTime = formatTime(time) //2022年1月22日 21:03:55

const formatTime = formatTime(time, false) //21:03:55
// 人民币格式化
const formatMoney = formatMoney(12345.678) // ¥12,345.68
// html转义(防止xxs攻击)
const htmlEscape = htmlEscape('<h1>hello</h1>') // &lt;h1&gt;hello&lt;/h1&gt;
// 浏览器缓存
cache.setCache(key, value) // 设置
cache.getCache(key) // 获取
cache.deleceCache(key) // 删除
cache.clearCache() // 清空

开源协议

ISC

1.0.2

3 years ago

1.0.1

3 years ago

1.0.8

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.0

3 years ago

0.1.0

8 years ago