New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

itheima-tools-sinan

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

itheima-tools-sinan

提供时间格式化以及HTMLEscape功能

latest
npmnpm
Version
1.0.0
Version published
Maintainers
1
Created
Source

安装

npm install itheima-tools-sinan

导入

const itheima = require("./itheima-tools-sinan");

格式化时间

const date = itheima.dateFormat(new Date()); // 2023-02-05 13:05:34

转义 html

const res = itheima.htmlEscape(
  '<h1 title="abc"><span>满江红&nbsp;</span></h1>'
); //&lt;h1 title=&quot;abc&quot;&gt;&lt;span&gt;满江红&amp;nbsp;&lt;/span&gt;&lt;/h1&gt;

还原转义 html

const res1 = itheima.htmlUnEscape(
  "&lt;h1 title=&quot;abc&quot;&gt;&lt;span&gt;满江红&amp;nbsp;&lt;/span&gt;&lt;/h1&gt;"
); // <h1 title="abc"><span>满江红&nbsp;</span></h1>

Keywords

itheima

FAQs

Package last updated on 03 Feb 2023

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