Package Exports
- student-han
- student-han/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 (student-han) 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 student-han
##导入
const student = require('student-han')
##格式化时间
// 调用时间
const str = student.dateformat(new Date())
// 输出结果
console.log(str);##转义HTML特殊字符
// 测试一个字符串并接受到htmlStr
const htmlStr = '<h1 style:"color: red">这是一个测试<span>字符串<span></h1>';
// 调用htmlescape来测试
const htstr = student.htmlescape(htmlStr);
// 输出结果
console.log(htstr);##还原HTML特殊字符
// 测试一段特殊的字符串
const ahtstr = '<h1 style:"color: red">这是一个测试<span>字符串<span></h1>'
// 根据上一个测试的结果反向测试
const unhtstr = student.htmlunescape(ahtstr);
// 输出结果
console.log(unhtstr);##开源协议 ISC