1.0.1 • Published 2 years ago
escape-wy v1.0.1
安装
npm install escape-wy
导入
const wy = require('./escape-wy');
格式化时间
const newdate = wy.dateformat(new Date());
console.log(newdate);
转义 HTML 中的特殊字符、还原 HTML 中的特殊字符
const htmlStr = '<h1>这是一个h1标题<span> </span></h1>';
const htmlEscape = wy.htmlEscape(htmlStr);
console.log(htmlEscape);
还原 HTML 中的特殊字符
const htmlUnEscape = wy.htmlUnEscape(htmlEscape);
console.log(htmlUnEscape);
开源协议
ISC