wyn3-tools

格式化时间,转义和还原

Usage no npm install needed!

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

README

安装

npm i wyn3-tools

导入

const wyn3 = require('./wyn3-tools')

格式化日期

const date = wyn3.dateFormat(new Date())
console.log(date);

转义

const str = '<h1>"你&nbsp;好"</h1>'
const str1 = wyn3.htmlEscape(str)
console.log(str1);

还原

const str2 = wyn3.htmlUnEscape(str1)
console.log(str2);

开源协议

ISC