Socket
Socket
Sign inDemoInstall

rss-tools

Package Overview
Dependencies
0
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    rss-tools

时间格式化,HTMLEscape


Version published
Weekly downloads
2
increased by100%
Maintainers
1
Created
Weekly downloads
 

Readme

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

FAQs

Last updated on 18 Oct 2022

Did you know?

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

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc