🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

itool

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

itool

I UTOOLS FOR ME AND YOU

1.0.8
latest
Source
npm
Version published
Weekly downloads
12
500%
Maintainers
1
Weekly downloads
 
Created
Source

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

Keywords

itool

FAQs

Package last updated on 23 Aug 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts