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

twikoo-func

v2.0.9

Published

Twikoo comment system backend for CloudBase

Readme

twikoo-func

Twikoo 2.0 服务端适配器。业务逻辑在 @twikoojs/common,本包仅做平台入口与注入。

⚠️ 2.0 升级须知(同名不同义)

包名没变,但包的内容变了。

| | 1.x | 2.0 | | ------------------------------------------- | ----------------------------------------- | ------------------------------------------ | | 定位 | 公共逻辑 + CloudBase 入口(代码全在这里) | 仅 CloudBase 薄适配器(< 150 行) | | 公共逻辑位置 | twikoo-func 内部(utils/、fn/ 等) | @twikoojs/common | | 旧导出(require('twikoo-func').utils 等) | 可用 | 不再导出(1.x 的整包转发已移除,见下) |

旧导出已移除:2.0 初版曾在 twikoo-func 上留了一层转发导出 (export * from '@twikoojs/common' + 加载即打印的弃用告警)作为 1.x 引用路径的过渡; 经确认没有外部依赖,已于 2026-09-19 移除(原计划 2.2.0,提前执行)。 require('twikoo-func').xxx 形式的公共函数调用不再可用——请把对公共逻辑的引用改为 @twikoojs/common(例外:main,它是 CloudBase 的挂载入口,长期保留)。

部署方式变更:tcb fn deploy / npm run deploy / login / logout 脚本与 @cloudbase/cli 依赖已移除,2.0 起只支持控制台部署(下方流程)。 这不影响云函数功能,也不影响控制台流程。

部署(CloudBase 控制台)

  1. CloudBase 控制台 → 云函数 → 创建函数(模板 Node.js Hello World,运行时 Node 24.11)
  2. 在线编辑器粘贴:exports.main = require("twikoo-func").main
  3. 在线装依赖:仅声明 twikoo-func(其余依赖随 npm 安装自动拉取)
  4. 创建后状态「正常」即部署完成

平台核对清单(查阅日期 2026-09-17)

  • [x] 函数入口 exports.main(event, context) 结构与返回体格式(docs.cloudbase.net 云函数章节)
  • [x] 控制台「在线编辑器 + 在线装依赖」流程;CLI(tcb fn deploy)2.0 起不再支持
  • [x] 运行时创建后不可改版本
  • [ ] 环境变量注入方式实测(人工项)
  • [ ] MONGODB_URI 外接 Mongo 实测(人工项)

注意

  • exports.main 导出名不可改(CloudBase 以此挂载)
  • 环境变量:MONGODB_URI(可选外接 Mongo)、TWIKOO_* 业务配置存于数据库配置