1.0.0 • Published 2 years ago

j-y-tools v1.0.0

Weekly downloads
-
License
ISC
Repository
-
Last release
2 years ago

安装

npm install j-tools

导入

const j_tools = require("j-tools")
const { ... } = require("j-tools")

格式化时间

// YYYY-MM-DD hh:mm:ss 格式是带年月份的
// hh:mm:ss 直接是时间
const dateString = j_tools.formatDate(new Date(), "YYYY-MM-DD hh:mm:ss" || "hh:mm:ss")

转义 HTML 中的特殊字符

const htmlString = j_tools.htmlEscape('<h1>Hello J_Tools</h1>')

开源协议

ISC

1.0.0

2 years ago