# sv_node_share

> An share library for node.js.

Latest version **1.1.28** (published 2019-05-24) · MIT license · 0 weekly downloads

## Install

```sh
npm install sv_node_share
pnpm add sv_node_share
yarn add sv_node_share
bun add sv_node_share
```

## 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.1.28 |
| Published | 2019-05-24 |
| First published | 2017-06-01 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 15 |
| Unpacked size | 58.4 KB |
| Known vulnerabilities | 0 (+2 in 2 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Author | NothingYF |
| Maintainers | nothingdocker |
| Keywords | sv_node_share |

## Links

- npm: https://www.npmjs.com/package/sv_node_share
- Repository: https://github.com/NothingYF/sv_node_share
- Homepage: https://github.com/NothingYF/sv_node_share#readme
- Issues: https://github.com/NothingYF/sv_node_share/issues
- npm.io page: https://npm.io/package/sv_node_share

## Dependencies (15)

- [mz](https://npm.io/package/mz.md) ^2.7.0
- [debug](https://npm.io/package/debug.md) ^2.6.8
- [busboy](https://npm.io/package/busboy.md) ^0.2.14
- [log4js](https://npm.io/package/log4js.md) ^1.1.1
- [moment](https://npm.io/package/moment.md) ^2.18.1
- [amqplib](https://npm.io/package/amqplib.md) ^0.5.1
- [ioredis](https://npm.io/package/ioredis.md) ^3.1.1
- [js-yaml](https://npm.io/package/js-yaml.md) ^3.9.1
- [request](https://npm.io/package/request.md) ^2.81.0
- [fs-extra](https://npm.io/package/fs-extra.md) ^3.0.1
- [urlencode](https://npm.io/package/urlencode.md) ^1.1.0
- [os-toolbox](https://npm.io/package/os-toolbox.md) ^0.2.7
- [base64-stream](https://npm.io/package/base64-stream.md) ^0.1.3
- [concat-stream](https://npm.io/package/concat-stream.md) ^1.6.0
- [metrics-process](https://npm.io/package/metrics-process.md) ^1.0.2

## Recent versions

- 1.1.28 (latest) — 2019-05-24
- 1.0.1 — 2017-06-07
- 0.1.3 — 2017-06-07
- 0.1.2 — 2017-06-03
- 0.1.1 — 2017-06-01
- 0.1.0 — 2017-06-01

## README

# sv_node_share
sv node share  

[![build status](https://git.scsv.online/node-public/sv_node_share/badges/master/build.svg)](https://git.scsv.online/node-public/sv_node_share/pipelines)

## 安装

需要node v7.6.0以上版本支持

```javascript

npm set registry http://npm.scsv.online
npm install sv_node_share --save
```

## Usage

### Cache

```javascript

const cache = require('sv_node_share').cache;


//初始化缓存,需在程序初始化时调用
cache.init('127.0.0.1', 6379, 0);

//设置缓存
cache.set('123', {id: '123'}, 60)

//获取缓存
cache.get('123');

//设置缓存失效时间
cache.expire('123', 60);

//删除缓存
cache.del('123')

//获取所有匹配键值
cache.keys('123*')

```

### logger

```javascript

const logger = require('sv_node_share').logger('test:server')

logger.info('hello');
logger.warn('hello');
logger.error('hello');

```

### request


```javascript

const request = require('sv_node_share').request;

await request.call('http://www.baidu.com');

await request.jsoncall('http://locahost:9000/jsontest', { id: '123' });

await request.getBase64(image_url);
```

### tools


```javascript

const request = require('sv_node_share').tools;

tools.isJSON({id: '123'});
await tools.sleep(1000);
await tools.exec('netstat -an');
tools.sysinfo();

```

### validate


```javascript

const validate = require('sv_node_share').validate;

validate.isMobile('13600000000');
validate.isQQ('1234567');
validate.isEmail('a@a.com');

```

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