0.0.2 • Published 1 month ago

lc-tools v0.0.2

Weekly downloads
-
License
-
Repository
-
Last release
1 month ago

安装

npm install lc-tools

导入

const lc = require('lc-tools')

格式化时间

//调用时间转换方法
const dtStr = lc.dateFormat(new Date())
console.log(dtStr);

转义

//转换html字符串
const htmlStr = '<h1 title="测试">这是测试标签!<span>09-&nbsp;16</span></h1>'
//调用方法
const htmlCs = lc.htmlEscape(htmlStr)
//结果 : &lt;h1 title=&quot;测试&quot;&gt;这是测试标签!&lt;span&gt;09-&amp;nbsp;16&lt;/span&gt;&lt;/h1&gt;
console.log(htmlCs)

//调用转换还原方法
//调用方法
const htmlUnCs = lc.htmlUnEscape(htmlCs)
//结果:<h1 title="测试">这是测试标签!<span>09-&nbsp;16</span></h1>
console.log(htmlUnCs)
0.0.1

1 month ago

0.0.2

1 month ago

1.1.0

2 years ago

1.0.0

2 years ago