Catalog npm
PACKAGE EXPLORERView in registry

7xia-utils

npm

提供了日期格式化, html字符转译等功能

77xiadateformatescape
Versions collected1
Direct dependencies0From release 1.0.0
Last observed20 Oct, 21:14 UTC

README

Current package documentation

安装

npm install 7xia-utils or npm i 7xia-utils

导入

const 7xiaUtils = require('7xia-utils')

日期格式化

// 调用 dateFormat 传入一个日期 对时间格式进行处理
const date = 7xiaUtils.dateFormat(new Date())
console.log('北京时间:' + date)
// 2023-03-28 11:11:59

escape HTML字符转译

// 调用 htmlEscape 对HTML字符进行转译
const str = '<h1 title="a" >这是<span>h1</span>标签</h1>'
const scape = 7xiaUtils.htmlEscape(str)
console.log(8, scape)
// &lt;h1 title=&quot;a&quot; &gt;这是h1标签&lt;/h1&gt

还原HTML特殊字符转译

// 调用 htmlUnEscape 还原已转译的HTML特殊字符
const unScape = time.htmlUnEscape(scape)
console.log(11, unScape)
// <h1 title="a" >这是<span>h1</span>标签</h1>

开源协议

ISC

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Versions 1

Collected releases
VersionPublishedDirect dependenciesOpen version
1.0.0Registry latest28 Mar 20230

Package advisories

0
No matching advisories collected

This describes our collected data; it is not a security assessment.

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 21:14 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package:e715869433d0d30662dae13ab756fc07c0ee9e308d27fb8036c26f50e65da21e