# some-tools-npm

> 几个小方法

Latest version **1.0.0** (published 2021-07-16) · MIT license · 0 weekly downloads

## Install

```sh
npm install some-tools-npm
pnpm add some-tools-npm
yarn add some-tools-npm
bun add some-tools-npm
```

## 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 | 2021-07-16 |
| First published | 2021-05-20 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 7.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | liuyaquan |
| Maintainers | liuyaq |
| Keywords | tools |

## Links

- npm: https://www.npmjs.com/package/some-tools-npm
- Repository: https://github.com/liuya6/some-tools
- Homepage: https://github.com/liuya6/some-tools#readme
- Issues: https://github.com/liuya6/some-tools/issues
- npm.io page: https://npm.io/package/some-tools-npm

## Recent versions

- 1.0.0 (latest) — 2021-07-16
- 0.0.9 — 2021-06-23
- 0.0.66 — 2021-05-21
- 0.0.63 — 2021-05-21
- 0.0.62 — 2021-05-21
- 0.0.61 — 2021-05-21
- 0.0.6 — 2021-05-20
- 0.0.5 — 2021-05-20
- 0.0.4 — 2021-05-20
- 0.0.3 — 2021-05-20
- 0.0.2 — 2021-05-20
- 0.0.1 — 2021-05-20

## README

# 简介
自用的一些小方法 就是玩儿

## 使用文档
```
npm i some-tools-npm
yarn add some-tools-npm
```
```js
import * as someTools from 'some-tools-npm';

const somTools = require('some-tools-npm');
```

### 1 computedVersion
版本号对比

```js
somTools.computedVersion("4.1.2.1.3", ">", "4.1.2.1.31")
``` 
>3个参数都是String 版本号格式 0.0.0

### 2 observer
 类似于vue的$on $emit $off 短小精干

```js
somTools.observer.$on("say", (message) => {
    console.log(message);
});
 
setTimeout(() => {
    somTools.observer.$emit("say", "我今年18岁");
}, 2000);
 
setTimeout(() => {
    somTools.observer.$off("say");
    somTools.observer.$emit("say", "我今年20岁");
}, 5000);
```
 >2秒后打印 我今年18岁 5秒后$off销毁了 就不触发了

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