npm install playboy123说明文件:不强制要求,一般用来提示用户如何使用
npm install itheima-tools
`
导入
`js
const ithema = require('itheima-tools')
`
时间格式化(当前时间)
`js
const now = itheima.dateFormat('YYYY-mm-dd HH:ii:ss')
console.log(now)
// 结果:2121-11-06 16:20:53
`
html实体化和反转
`js
// 实体化
const htmlEncode = itheima.htmlEscape('hello world')
console.log(htmlEncode)
// 结果:<div class="current">hello world</div>
// 反转
const htmlDecode = itheima.htmlEscapeUncode('<div class="current">hello world</div>')
console.log(htmlDecode)
// 结果:hello world
``