wl-node-uils

1.0.0 • Public • Published

安装

npm install wl-node-utils

导入

const utils=require("wl-node-utils")

API

日期格式化

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

html字符转化为转义字符

let str = '

你好!&copy小黄

' let str2 = utils.htmlEscap(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.htmlUnEscap(str) //打印:

你好!&copy小黄

console.log(str2)

Readme

Keywords

Package Sidebar

Install

npm i wl-node-uils

Weekly Downloads

1

Version

1.0.0

License

ISC

Unpacked Size

3.17 kB

Total Files

7

Last publish

Collaborators

  • wenlei_dsb