Catalog npm
PACKAGE EXPLORERView in registry

3itshuai-tools

npm

提供了格式化时间,HTMLEscape的功能

dateformatescapeitheima
Versions collected1
Direct dependencies0From release 1.0.0
Last observed20 Oct, 19:46 UTC

README

Current package documentation

安装

  npm intsall 3itshuai-tools

导入

  const itheima = require('itheima-tooole')

格式化时间

const dt = dataFamort.dataFormat(new Date());
console.log(dt) //2023-08-13 11:45:34

转义HTML特殊字符

const str = dataFamort.htmlEscape(htmlStr)
 
 <h1 title='abc'>这是一个<span>123&nbsp;</span><h1></h1>
 // &lt;h1 title='abc'&gt;这是一个&lt;span&gt;123&amp;nbsp;&lt;/span&gt;&lt;h1&gt;&lt;/h1&gt;

还原HTML

const str2 = dataFamort.htmlUnEscape(htmlUnStr)

const htmlUnStr ="&lt;h1 title='abc'&gt;这是一个&lt;span&gt;123&amp;nbsp;&lt;/span&gt;&lt;h1&gt;&lt;/h1&gt;"

//结果
<h1 title='abc'>这是一个<span>123&nbsp;</span><h1></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 latest13 Aug 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, 19:46 UTC

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

Record identity

package:5a8943959ed2ddf544772d4fb81ab18a502046d577493c8821fec1dd0b73f1d4