itheima-tools-bsuc

1.0.0 • Public • Published

操作文档

安装

npm i ithema-tools-bsuc

导入

const itheima = require('itheima-tools-bsuc')

方法

格式化时间

// 调用 dataFormat 方法,对时间进行格式化
const dtStr = itheima.dateFormat(new Date())
console.log(dtStr)

转义HTML字符串

const htmlStr = '<h1 title="abc">这是h1标签</h1>'
const newStr = itheima.escapeHtml(htmlStr)
console.log(newStr);

还原HTML字符串

const newUnStr = itheima.unescapeHtml(htmlStr)
console.log(newUnStr);

开源协议

ISC

Package Sidebar

Install

npm i itheima-tools-bsuc

Weekly Downloads

2

Version

1.0.0

License

ISC

Unpacked Size

2.94 kB

Total Files

5

Last publish

Collaborators

  • kingbinbin