1.0.2 • Published 2 years ago

itheima-tools-sun v1.0.2

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

安装方式

npm install itheima-tools

导入方式

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

格式化时间

//  调用getTime对时间进行格式化
const j = n.getTime(new Date())
// 2020-12-2  17:00:00
console.log(j);

转移html中特殊字符

//  带转换的HTML字符
const htmlStr = '<h1>这是一个标签 <span>123 &nbsp</span></h1>';
//  转移完成的HTML字符
const d = n.getStr(htmlStr);
console.log(d);

还原HTML中特殊字符

//  带还原的HTML字符
const m = n.unStr(d);
//  输出的结果
console.log(m);

开源协议

ISC