You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

rss-tools

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rss-tools

时间格式化,HTMLEscape

1.0.1
latest
npmnpm
Version published
Maintainers
1
Created
Source

安装

npm install rss-tools

导入

const r = require('rss-tools')

格式化时间

const dtStr = r.dateFormat(new Date())
// 2022-10-18 19:52:55

转义/还原 HTML 特殊字符

const htmlStr = '<h1 title="abc">zheshih1 <span>123&nbsp</span> </h1>'
const str = r.htmlEscape(htmlStr)
// &lt;h1 title=&quot;abc&quot;&gt;zheshih1 &lt;span&gt;123&amp;nbsp&lt;/span&gt; &lt;/h1&gt;
const str1 = r.htmlUnEscape(str)
// <h1 title="abc">zheshih1 <span>123&nbsp</span> </h1>

开源协议

ISC

Keywords

r

FAQs

Package last updated on 18 Oct 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.