wechat-yoo
TypeScript icon, indicating that this package has built-in type declarations

0.1.3 • Public • Published

wechat-yoo JavaScript Style Guide

一个基于TypeScript的微信公众平台开发框架.

Installation

npm install wechat-yoo

Usage

Koa

npm install koa koa-bodyparser

index.ts:

import Yoo from 'wechat-yoo'
import koaAdapter from 'wechat-yoo/adapters/koa.js'
import Koa from 'koa'
import bodyParser from 'koa-bodyparser'

const yoo = new Yoo('Token')
yoo.default(async (reply, data) => {
  reply.text('Welcome to use WeChatYoo!')
  console.log(data)
})

const app = new Koa()

app.use(bodyParser({ enableTypes: ['xml'] })).use(koaAdapter(yoo.callback())).listen(8123)

console.log('Started!')

Options

new Yoo({
  token: 'Token',
  key: 'EncodingAESKey',
  appid: 'AppId',
  secret: 'AppSecret',
  autoFetchAccessToken: false,
  accessTokenCacheFile: '.yoo-access-token.json'
})

Author

Shirasawa

License

MIT

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
0.1.32latest

Version History

VersionDownloads (Last 7 Days)Published
0.1.32
0.1.20
0.1.10
0.1.00
0.0.20
0.0.10

Package Sidebar

Install

npm i wechat-yoo

Weekly Downloads

2

Version

0.1.3

License

MIT

Unpacked Size

24.8 kB

Total Files

11

Last publish

Collaborators

  • ncbql