1.0.0 • Published 2 years ago
an-utils999 v1.0.0
安装
npm install an-utils
yarn add an-utils
导入
const anutils = require('an-utils')
格式化时间
const dtStr = anutils.dateFormat(new Date());
console.log(dtStr);
<!-- 2022-05-23 11:42:48 -->
html 转义 和 转义成 html
const htStr = anutils.htmlEscape("<h1>这是h1标签</h1>");
console.log(htStr);
// <h1>这是h1标签</h1>
const htStr2 = anutils.htmlUnEscape("<,>");
console.log(htStr2);
// <,>
格式化金钱
const money = anutils.moneyFormat(100);
console.log(money);
// ¥100
开源协议
ISC
1.0.0
2 years ago