# my-custom-node-tww

> 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 dates = date.getDate() var hour = date.getHours(

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

## Install

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

## 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.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | tangweiwen08 |

## Links

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

## Recent versions

- 1.0.0 (latest) — 2022-10-11

## README

## 1.安装方式
### 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 dates = date.getDate()
	var hour = date.getHours()
	var minute = date.getMinutes()
	var second = date.getSeconds()
	console.log(year+"年"+month+"月"+dates+"日\t"+hour+":"+minute+":"+second)
}
## 4.转义HTML中的特殊字符
function zhuanHtml(html){
	return html.replace(/<|>|"|&/g,(match)=>{
		switch(match) {
			case'<':
			return '&lt;'
			case'>':
			return '&gt;'
			case'"':
			return '&quot;'
			case'&':
			return '&amp;'
		}
	})
}
## 5.还原HTML中的特殊字符
function huanHtml(html){
		return html.replace(/&lt;|&gt;|&quot;|&amp;/g,(match)=>{
		switch(match) {
			case'&lt;':
			return '<'
			case'&gt;':
			return '>'
			case'&quot;':
			return '"'
			case'&amp;':
			return '&'
		}
	})
}
## 6.开源协议
ISC

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