# @4a/alisms

> 阿里云SMS

Latest version **0.1.1** (published 2021-08-31) · MIT license · 0 weekly downloads

## Install

```sh
npm install @4a/alisms
pnpm add @4a/alisms
yarn add @4a/alisms
bun add @4a/alisms
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.1 |
| Published | 2021-08-31 |
| First published | 2020-04-23 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 4.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | gavinning |
| Maintainers | gavinning |
| Keywords | aliyun, aliyun-sms, alisms, sms |

## Links

- npm: https://www.npmjs.com/package/@4a/alisms
- Repository: https://github.com/gavinning/alisms
- Homepage: https://github.com/gavinning/alisms#readme
- Issues: https://github.com/gavinning/alisms/issues
- npm.io page: https://npm.io/package/@4a/alisms

## Dependencies (1)

- [@alicloud/pop-core](https://npm.io/package/@alicloud/pop-core.md) ^1.7.9

## Recent versions

- 0.1.1 (latest) — 2021-08-31
- 0.1.0 — 2020-04-23

## README

Alisms
---
阿里云短信验证码发送和验证

### Install
```sh
npm i @4a/alisms
```

### Usage
```js
const AliSMS = require('@4a/alisms')
const AliSMSConfig = {
    AccessKeyId: "your AccessKeyId",
    AccessKeySecret: "your AccessKeySecret",
    RegionId: 'your RegionId',
    SignName: 'your SignName',
    TemplateCode: 'your TemplateCode'
}

const Redis = require('ioredis')
const redis = new Redis()

const alisms = new AliSMS({ ...AliSMSConfig, redis })


// 创建一个短信验证码
// 模拟发送，测试环境使用该api
alisms.create(telephone)


// 创建一个短信验证码
// 真实发送，生产环境使用该api
alisms.publish(telephone)


// 验证短信验证码是否合法
alisms.verify(telephone, code)
```

### Example
> npm test

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