Socket
Socket
Sign inDemoInstall

lsk-xss-safe

Package Overview
Dependencies
0
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    lsk-xss-safe

提供了格式化时间、HTMLEscape相关的功能


Version published
Weekly downloads
1
Maintainers
1
Created
Weekly downloads
 

Readme

Source

安装

npm install lsk-xss-safe

导入

const xssSafe = require('lsk-xss-safe')

格式化时间

const dtStr = xssSafe.dateFormat(new Date())

转义 HTML 中的特殊字符

const htmlStr = '<h1 title="abc">我是h1标签<span>123&nbsp;</span></h1>'
const str = xssSafe.htmlEscape(htmlStr)

还原 HTML 中的特殊字符

const str2 = xssSafe.htmlUnEscape(str)

开源协议

ISC

Keywords

FAQs

Last updated on 21 Dec 2023

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