biu-tools

1.0.0 • Public • Published

##安装

npm install biu-tools

##导入

const index = require("biu-tools");

##格式化时间

//调用dateFormat对时间格式化
const dtStr = index.dateFormat(new Date());
//打印格式化的时间
console.log(dtstr);

##转义和还原 HTML 中的特殊字符

//带转换的HTML字符串
const htmlStr = index.htmlEscape("<>|&123");
//转换的结果是 &lt;&gt;|&amp;123
console.log(htmlStr);
//还原带转换的HTML字符串
const BackHtmlStr = index.htmlEsback(htmlStr);
//转换的结果是 <>|&123
console.log(BackHtmlStr);

##开源协议 ISC

Package Sidebar

Install

npm i biu-tools

Weekly Downloads

1

Version

1.0.0

License

ISC

Unpacked Size

2.43 kB

Total Files

6

Last publish

Collaborators

  • whowereallyare