hejing-node-utils

1.0.1 • Public • Published

###安装 npm install hejing-node-utils

###导入模块 const utils = require('hejing-node-utils')

日期时间处理函数

const dd = utils.dateFormater(new Date())
//打印 yyyy-MM-dd HH:mm:ss console.log(dd)

html字符转换为转义字符

let str = '

你好!&copy小黄

' let str2 = utils.htmlEscape(str)
//打印:<h1 style="color:red;">你好!&copy<span>小黄</span></h1> console.log(str2)

转义字符转换为html字符

let str = '<h1 style="color:red;">你好!&copy<span>小黄</span></h1>' let str2 = utils.htmlUnEscape(str) //打印:

你好!&copy小黄

console.log(str2)

协议

ISC

Readme

Keywords

Package Sidebar

Install

npm i hejing-node-utils

Weekly Downloads

1

Version

1.0.1

License

ISC

Unpacked Size

3.75 kB

Total Files

9

Last publish

Collaborators

  • hejing115120129