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 🙏

© 2025 – Pkg Stats / Ryan Hefner

bebark

v2.0.6

Published

A tool library for the begonia framework

Downloads

8

Readme

begonia-bark

介绍

begonia-bark是用于微信小程序开发的工具库。可以提供多项实用功能。 每项大功能都以模块的形式存在,并保持相对独立性。因此,既可以单独使用,也可以和begonia框架搭配使用。

begonia-bark中的模块并非都是按照begonia规定的模块定义方式产生的增强模块,因此可以直接导入并使用,而不必使用begonia进行装载。

安装

1. 首先使用npm进行安装

npm install bebark

2. 小程序npm构建

使用微信小程序开发工具--->工具--->构建npm,进行npm包进行构建

3. 导入包进行使用

以网络http请求对象为例:

import Request from 'bebark/http/Request';

// post 请求
Request.post(url, data, {/* ...其他设置,例如header */})
  .then(function(res) {
    // do something
  })
  .catch(function(err) {
    // catch an error
  });

功能

begonia-bark目前提供如下功能,具体使用细节,可以查看相应的文档:

  • 帧模拟 frame 提供帧模拟循环,可以用来实现动画或者canvas动画帧循环
  • http请求对象 Request 对小程序http请求方法进行封装,并提供Promise形式返回。
  • log日志 LogManager 提供自定义形式的日志,每条日志为一个日志对象,并基于4种级别日志(trace, info, warn, error)提供相应的css类型,可自定义颜色等样式。
  • 网络状态 NetService 利用小程序api检测网络状态和监控网络状态
  • 通用对象池 pool 利用一个类的构造函数创建此类的专属对象池,通过管理对象获取和回收,控制内存使用。
  • 缓存处理 StorageManager 将小程序缓存api进行封装,提供特定的格式来存储数据的值、过期时间和参数等信息,并提供过期检查、过期删除等功能。
  • 版本检测 versionCheck 通过对当前运行的环境的小程序基础库版本和指定的基础库版本进行对比,可以利用结果回调来判断是否应提示用户进行升级。
  • 线程管理 WorkerManager 封装了小程序worker的api,内置worker使用队列,并提供自动销毁自动切换线程任务的功能。

license

MIT