Catalog npm
PACKAGE EXPLORERView in registry

17-itheima-tools-ceshiceshi

npm

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

17-itheima-tools-ceshiceshidateformatescape
Versions collected1
Direct dependencies0From release 1.0.0
Last observed20 Oct, 18:17 UTC

README

Current package documentation

安装

npm install 17-itheima-tools-ceshiceshi

导入

const itheima = require('17-itheima-tools-ceshiceshi')

格式化时间

const dt = itheima.dateFormat(new Date())
console.log('格式化后的时间:', dt);

转义 HTML 中的特殊字符

// 待转换的 HTML 字符串
const htmlStr = '<h1 style="color:red;">你好, &copy;<span>小黄!</span></h1>'
// 调用 htmlEscape 方法进行转换
const str = itheima.htmlEscape(htmlStr)
console.log('转义后的字符:', str);

还原 HTML 中的特殊字符

const htmlUn = itheima.htmlUnEscape(str)
console.log('还原特殊字符串后的HTML:', htmlUn);

开源协议

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 latest5 Jun 20220

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, 18:17 UTC

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

Record identity

package:201320ff9952023af6ff41038d2bc9f7acf2e41cb4efd62d0426242103514c4c