itiheima-tools-zb
1.0.0 • Public • Published
node install itheima-tools-zb
const itheima = require('itheima-tools-zb');
//代码演示
const date = new Date();
console.log(itheima.dateFormat(date));
//输出结果 2022-11-08 14:12:43
//代码演示
const htmlStr = '<h1 href="&">这是一个HTML转义字符的方法</h1>';
console.log(itheima.HTMLEscape(htmlStr));
//输出结果 <h1 href="&">这是一个HTML转义字符的方法</h1>
//代码演示
const htmlStr = '<h1 href="&">这是一个还原HTML转义字符的方法</h1>';
const str = itheima.HTMLEscape(htmlStr);
console.log(itheima.HTMLUnEscape(str));
//输出结果 <h1 href="&">这是一个还原HTML转义字符的方法</h1>
ISC
Package Sidebar
Install
Weekly Downloads