xiaobo-tools-c

提供了格式化时间,HTMLEscape相关功能

Usage no npm install needed!

<script type="module">
  import xiaoboToolsC from 'https://cdn.skypack.dev/xiaobo-tools-c';
</script>

README

安装

npm i xiaobo-tools-c

导入

const xiaobo = require('./xiaobo-tools-c/1.index')

格式化日期

// 格式化时间的功能
const dtStr = xiaobo.dateFormat(new Date())
console.log(dtStr);

测试 转译

//  带转换的HTML字符串 
const htmlStr = '<h1 title="abc">这是h1标签<span>123&nbsp</span></h1>'
//  调用htmlEscape方法进行转换 
const str = xiaobo.htmlEscape(htmlStr)
//  转换的结果 
console.log(str);

测试 还原

// 带还原的html字符串

const str2 = xiaobo.htmlUnEscape(str)
console.log(str2);

开源协议

ISC