# my-custom-node-mjy

> npm i my-tools ## 2.导入方式 const my = require("my-tools") ## 3.格式化时间 ``` //格式化时间 function dateFormat(){ var date=new Date() var year=date.getFullYear(); var month=date.getMonth()+1; var today=date.getDate(); var hour=date.

Latest version **1.0.0** (published 2022-10-11) · ISC license · 0 weekly downloads

## Install

```sh
npm install my-custom-node-mjy
pnpm add my-custom-node-mjy
yarn add my-custom-node-mjy
bun add my-custom-node-mjy
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2022-10-11 |
| First published | 2022-10-11 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 2.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | jennyhourse |

## Links

- npm: https://www.npmjs.com/package/my-custom-node-mjy
- npm.io page: https://npm.io/package/my-custom-node-mjy

## Recent versions

- 1.0.0 (latest) — 2022-10-11

## README

##安装方式
### 1.1使用npm安装
  npm i my-tools
## 2.导入方式
    const my = require("my-tools")
## 3.格式化时间
```
//格式化时间
function dateFormat(){
    var date=new Date()
    var year=date.getFullYear();
    var month=date.getMonth()+1;
    var today=date.getDate();
    var hour=date.getHours();
    var minute=date.getMinutes();
    var second=date.getSeconds();

    var time=year+"年"+month+"月"+today+"日 "+hour+":"+minute+":"+second;
    console.log(time);
}
```
## 4转义HTML中的特殊字符
```
//转义字符
function zhuanHTML(html){
    html.replace(/<|>|"|&/g,(i)=>{
        switch (i){
            case "<":
                return &lt;
            case ">":
                return &gt;
            case '"':
                return &quot;
            case '&':
                return &amp;
        }
    })
}
```
## 5还原特殊字符
```
//还原特殊字符
function huanHTML(html){
return html.replace(/&lt|&gt|&quot|&amp/g,(i)=>{
switch (i){
case "&lt":
return "<";
case "&gt":
return ">";
case '&quot':
return '"';
case '&amp':
return "&";
}
})
}
```
## 6开源协议
RSC

---
_Source: https://npm.io/package/my-custom-node-mjy · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
