npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

jmcloudfunc

v2.0.12

Published

callFunc抛出异常时的问题

Readme

JmCloudFunc

jmcloudfunc是微信小程序云函数的接口优化库

jmcloudfunc有以下几个特性: 1.让单个云函数方便的定义多个方法来接收调用 2.方法通过目录的方式存放和访问如'manage/activity-create' 3.强大的输入完整性检测,定义了各种输入变量类型

第一步,在与函数中安装 jmcloudfunc

npm i jmcloudfunc

第二步,修改云函数入口index.js 中的main方法

const JmCloudFunc = require('jmcloudfunc')
exports.main = async (event, context) => {
 return await JmCloudFunc(cloud, event, context)
}

第三步,(举例)在云函数根目录下创建funcs文件夹,在funcs文件夹中创建方法文件

如funcs/activity-create.js(activity-create可以替换为任何你想要的名称)

文件内容格式模板为

module.exports = {
  title: '创建一个活动',
  desc: '',
  fields: {
    title: { type: "text", text: "活动名称", required: true },
    desc: { type: "text", text: "活动描述", required: false },
    date: { type: "date", text: "日期", required: true },
    time: { type: "time", text: "时间", required: true },
  },
  errors: {
    duplicate_title:{message:'重复的活动标题重复了'}
  },
  returns: {},
  async onResponse({ options, cloud }) {
    let {title,desc,date,time} = options


    this.setReturns({})
  },
}