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

xytmm

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

xytmm

提供了格式化时间的功能

latest
npmnpm
Version
1.0.0
Version published
Maintainers
1
Created
Source

安装

npm install xytmm

导入

const xytmm = require("xytmm");

格式化时间

// 调用dateformat,对时间进行格式化
const dtstr = xy.dateformat(new Date());
// 结果 2022-08-25 17:25:41
console.log(dtstr);

转义 html 中的特殊字符

const str = "<h1>这是h1</h1>";
const dp = xy.escape(str);
// 转换结果  &lt;h1&gt;这是h1&lt;/h1&gt;
console.log(dp);

还原 html 中的特殊字符

const dd = xy.restore(dp);
// 还原结果  <h1>这是h1</h1>
console.log(dd);

开源协议

ISC

Keywords

xytmm

FAQs

Package last updated on 25 Aug 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