Package Exports
- itheima-tools-freddy
- itheima-tools-freddy/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (itheima-tools-freddy) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
##安装
npm install itheima-tools-freddy
##导入
const itheima = require("itheima-tools");##格式化时间
const dtStr = itheima.dateFormat(new Date());
// 结果 2022-02-15,21:28:00
console.log(dtStr);const str = "<h1>这是个测试字段</h1>";
const htmlStr = itheima.htmlEscape(str);
// 结果 <h1>这是个测试字段</h1>
console.log(htmlStr);##还原 HTML 中的特殊字符
const str = "<h1>这是个测试字段</h1>";
const htmlStr = itheima.htmlUnEscape(str);
// 结果 <h1>这是个测试字段</h1>
console.log(htmlStr);