# fetch-wechat

> browser fetch polyfill for wechat mini program platform

Latest version **0.0.3** (published 2019-03-27) · MIT license · 0 weekly downloads

## Install

```sh
npm install fetch-wechat
pnpm add fetch-wechat
yarn add fetch-wechat
bun add fetch-wechat
```

## Health

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

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.3 |
| Published | 2019-03-27 |
| First published | 2019-03-27 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 745.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 10 |
| Maintainers | pyu10055 |

## Links

- npm: https://www.npmjs.com/package/fetch-wechat
- Repository: https://github.com/pyu10055/fetch-wechat
- Homepage: https://github.com/pyu10055/fetch-wechat#readme
- Issues: https://github.com/pyu10055/fetch-wechat/issues
- npm.io page: https://npm.io/package/fetch-wechat

## Recent versions

- 0.0.3 (latest) — 2019-03-27
- 0.0.2 — 2019-03-27
- 0.0.1 — 2019-03-27

## README

# fetch-wechat
Fetch polyfill for WeChat mini program platform to work with
[TensorFlow.js](https://github.com/tensorflow/tfjs).

TensorFlow.js allow you to load models served by HTTPs server. There are two model loading APIs 
-  tf.loadGraphModel
-  tf.loadLayerModel

Both of which requires a [fetch](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API) API exposed on the global scope or provided as part of the loadOption field.

The library is essentially a wrapper of wx.request API that simulates the fetch API. This is inspired by [wxapp-fetch](https://github.com/axetroy/wxapp-fetch), with simpler code base and support of arraybuffer function.

Code example:

```
import { fetchFunc } from 'wechat_fetch';

const model = await tf.loadGraphModel(
      'https://model.url.com/model.json', {fetchFunc: fetchFunc()});
```

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