# universal-miniapp-api-interceptor

> MiniApp api interceptor

Latest version **1.0.0** (published 2019-12-13) · BSD-3-Clause license · 0 weekly downloads

## Install

```sh
npm install universal-miniapp-api-interceptor
pnpm add universal-miniapp-api-interceptor
yarn add universal-miniapp-api-interceptor
bun add universal-miniapp-api-interceptor
```

## 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 | 2019-12-13 |
| First published | 2019-12-13 |
| Weekly downloads | 0 |
| License | BSD-3-Clause |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | balloonzzq |
| Maintainers | rax-publisher |
| Keywords | universal, api |

## Links

- npm: https://www.npmjs.com/package/universal-miniapp-api-interceptor
- Homepage: https://github.com/raxjs/universal-api
- npm.io page: https://npm.io/package/universal-miniapp-api-interceptor

## Recent versions

- 1.0.0 (latest) — 2019-12-13

## README

[![npm](https://img.shields.io/npm/v/universal-miniapp-api-interceptor.svg)](https://www.npmjs.com/package/universal-miniapp-api-interceptor)

Each platform Mini App interceptor function, through the provided factory function can quickly access the multi-platform Mini App API.

## Installation

```bash
$ npm install universal-miniapp-api-interceptor --save
```

## Usage

```js
import { apiInterceptor, apiEventHandlerInterceptor } from 'universal-miniapp-api-interceptor';

const scanCode = apiInterceptor(my, {
  method: 'scan',
  optionsInterceptor: (options: IOptions) => {
    // process options
    return options;
  },
  successInterceptor: (res: any) => {
    // process success result
    return res;
  },
  failInterceptor: (err: any) => {
    // process fail error
    return err;
  }
});

const onAccelerometerChange = listenerInterceptor(my, {
  method: 'onAccelerometerChange'
});
```

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