1.0.0 • Published 10 months ago
demo02-ouyang v1.0.0
##安装方式
npm install demo02-ouyang
##导入
const ouyang = require('demo02-ouyang')
##格式化时间
//调用dateFormat对时间进行格式化
const data=ouyang.dateFormat(new Date())
consloe.log(data)
##格式化时间
//调用dateFormat对时间进行格式化
const data=ouyang.dateFormat(new Date())
consloe.log(data)
//结果 2023-07-15 16:46:36
##转义HTML中的特殊字符
//带转换的HTML字符串
const htmlStr='<h1>Hello</h1>'
//调用htmlEscape方法进行转换
const str=ouyang.htmlEscape(htmlStr)
//转换的结果<h1>Hello</h1>
consloe.log(str)
##还原HTML中的特殊字符
//带还原的HTML字符串
const htmlStr='<h1>Hello</h1>'
//调用htmlUnEscape方法进行转换
const str=ouyang.htmlUnEscape(htmlStr)
//转换的结果<h1>Hello</h1>;
consloe.log(str)
##开源协议
ISC
1.0.0
10 months ago