bundle-tools-forthisright

1.0.0 • Public • Published

安装

npm install Bundle-tools

导入

const Bundle-tools = require('Bundle-tools')

格式化时间

//调用dateFormat对时间进行格式化
const dtStr = Bundle.dateFormat(new Date())
console.log(dtStr)

转义HTML中的特殊字符

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

还原HTML中的特殊字符

//定义了待还原的HTML字符串
const str2 = Bundle.htmlUnEscape(str)
//调用方法进行转换
console.log(str2) 

开源协议

MIT

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.0
    0
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.0.0
    0

Package Sidebar

Install

npm i bundle-tools-forthisright

Weekly Downloads

0

Version

1.0.0

License

MIT

Unpacked Size

2.5 kB

Total Files

5

Last publish

Collaborators

  • nullgm