# log-push

> push log by aliyun sms or server酱

Latest version **1.0.1** (published 2016-11-25) · MIT license · 0 weekly downloads

## Install

```sh
npm install log-push
pnpm add log-push
yarn add log-push
bun add log-push
```

## 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.1 |
| Published | 2016-11-25 |
| First published | 2016-11-25 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| Author | tsq |
| Maintainers | tangshiqiang |

## Links

- npm: https://www.npmjs.com/package/log-push
- Repository: https://github.com/tsq-happy/log-push
- Homepage: https://github.com/tsq-happy/log-push#readme
- Issues: https://github.com/tsq-happy/log-push/issues
- npm.io page: https://npm.io/package/log-push

## Dependencies (2)

- [ali-sms](https://npm.io/package/ali-sms.md) ^1.0.0
- [request](https://npm.io/package/request.md) ^2.79.0

## Recent versions

- 1.0.1 (latest) — 2016-11-25
- 1.0.0 — 2016-11-25

## README

# log-push
Note: This module just can be used in China

Push something (like server logs) to phone or wechat. It use [Aliyun SMS](https://github.com/tsq/ali-sms) to do sms and use [Server酱](http://sc.ftqq.com/3.version) to do wechat notification

## Install

```
npm install log-push
```

## Config

#### Push by SMS

param|type|description
----|----|---|----
accessKeyID | string | access key id, get from aliyun
accessKeySecret | string | access key secret, get from aliyun 
paramString | object | ali sms param which you have defined on aliyun sms dashboard
recNum | array | phone numbers of users
signName | string | ali sms param, get from aliyun sms dashboard
templateCode | string | ali sms param, get from aliyun sms dashboard
notifyWay | string | must be `sms`

#### Push by Wechat

param|type|description
----|----|---|----
serverJiangKey | string | access key from `server酱`
wechatText | string | the title of wechat message
wechatDesp | string | the content of wechat message

**NOTE:** All parameters is required

#### Usage

```javascript
const logPush = require("log-push");

const configWechat = {
  serverJiangKey: process.env.SERVER_JIANG_KEY,
  wechatText: '数星星',
  wechatDesp: `一共有${Math.ceil(Math.random() * 100)}个`
};

const configSMS = {
  accessKeyID       : process.env.ALI_SMS_ACCESSKEYID,
  accessKeySecret   : process.env.ALI_SMS_ACCESSKEYSECRET,
  paramString       : {code: '一起去大保健'},
  recNum            : ['17705143392'],
  signName          : '久康云',
  templateCode      : 'SMS_28100008',
  notifyWay         : 'sms',
};

logPush(configWechat, (err) => console.log(err));
logPush(configSMS, (err) => console.log(err));
```

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