1.0.0 • Published 3 years ago

itheima-zwl-tools v1.0.0

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

安装

npm install itheima-zwl-tools

导入

const itheima_zwl_tools = require('itheima_zwl_tools');

格式化时间

// 调用dateFormat格式化时间
const formatDate = itheima_zwl_tools.dateFormat(new Date());

HTML中的转移字符

//需要转换的HTML字符
const htmlStr = '<h1 title="anc">这是h1标签字符<span>123&nbsp;</span></h1>';

//调用htmlEscape转换
const escapeStr = itheima_zwl_tools.htmlEscape(htmlStr);

还原HTML字符

const unEscapeStr = itheima_zwl_tools.htmlUnEscape(escapeStr);

开源协议

ISC