@nayotta/mta-wechat-mp
TypeScript icon, indicating that this package has built-in type declarations

0.2.3 • Public • Published

mta-wechat-mp

Build & Lint & TestNode.js Package

en

基于 javascript/typescript 环境的非官方微信小程序资源sdk

安装

$ npm install @nayotta/mta-wechat-mp

使用

import { MtaWechatMp } from '@nayotta/mta-wechat-mp'

const mtaWechatMp = new MtaWechatMp({
	appid: 'your_app_id',
	secret: 'your_app_secret',
	cloudEnvs: {
		develop: 'develop_cloud_env_id',
		production: 'production_cloud_env_id'
	},
	// 可选,虽然支持代理,但不建议在客户端进行操作
	proxy: {
		proxyUrl: 'http://localhost:2333/mp'
	},
	// 设置时区,默认为本地时区
	tz: 'Asia/Shanghai'
})

// 云开发资源
const {
	// 数据库
	db: devDb,
	// 云函数
	func: devFunc,
	// 存储
	storage: devStorage
} = mtaWechatMp.clouds.develop

// 数据分析
mtaWechatMp.analysis.getVisitTrend({
	type: 'daily',
	beginDete: '2021-12-22',
	endDate: '2021-12-22'
}).then(res => {
	console.log(res)
}).catch(err => {
	console.error(err)
})

待完善

  • 添加说明文档(打算使用GitHub wiki);

  • 添加更多单元测试;

  • 持续添加其他模块,欢迎大家来提PR;

Package Sidebar

Install

npm i @nayotta/mta-wechat-mp

Weekly Downloads

0

Version

0.2.3

License

MIT

Unpacked Size

63.6 kB

Total Files

48

Last publish

Collaborators

  • goku-gaga
  • classlfz