1.0.0 • Published 9 months ago

jess-tools v1.0.0

Weekly downloads
-
License
ISC
Repository
-
Last release
9 months ago

安装

npm install jess-tools

导入

const jessTool= require('jess-tools')

格式化时间

const df = require('jess-tools')
//对时间进行格式化
const res =df.dateFormat('2021-10-1 10:10:1','dd/MM/yyyy hh:mm:ss')

// 结果 1/10/2021 10:10:1
console.log(res);

转义 html 特殊字符

const res1 = df.htmlEscape('<h1 class="h1">hello</h1>')

console.log(res1);
//&lt;h1 class=&quot;h1&quot;&gt;hello&lt;/h1&gt;
const res2 = df.htmlUnEscape(res1)
console.log(res2);
//<h1 class="h1">hello</h1>

开源协议

ISC

1.0.0

9 months ago