1.1.0 • Published 4 years ago
ssj v1.1.0
安装
npm install ssj导入
const ssj = require('ssj')格式化时间
// 调用dateFormat进行格式化
const time = ssj.dateFormat(new Date())
console.log(time)转义 HTML
// 待转换的 HTML 字符串
const htmlStr = '<h1> hello </h1>'
const str = ssj.htmlEscape(htmlStr)
console.log(str)还原 HTML
const str2 = ssj.htmlUEscape(str)
console.log(str2)开源协议
ISC