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

looplan-serverless

v0.7.8

Published

基于bun的serverless框架

Downloads

23

Readme

LooplanServerless

基于bun的serverless框架

安装

bun install looplan-serverless
# 安装数据库 | 验证 | jwt工具
bun install looplan-orm zod jose

更新记录

  • 2025年12月11日 : 修复bug
  • 2025-11-8: 新增事件系统, 解决并发时事务冲突问题
  • 2025-8-29: 认证增加rsa算法
  • 2025-7-11: _init, _after 方法, 认证问题

描述

  • 作者是一名多年使用PHP+vue的开发者, 由于不喜欢PHP一些特性(如: 数组和对象的定义,composer的问题等), 所以才开发了这个框架,最终放弃使用PHP
  • 让前后端写法更接近, 减少成本
  • 当前处理设计验证阶段, 还没有正式使用
  • 后续将会制作并开源几个使用这个框架的项目
  • 如果希望共同开发, 请加入技术讨论QQ群: 1047604746

设计思想

  • 函数按照PHP主流框架的写法
  • 采用Serverless云函数+云对象的访问模式
  • 集成常用的api开发依赖, 如: 数据库操作, 验证, jwt工具等
  • 导出类型供前端使用, 如: 云函数的参数类型, 云对象的方法类型等

定义函数 | 对象

  • 感受一下LooplanServerless的写法

云函数

  • functions/test1.ts

import { Db } from 'looplan-orm'

/**
 * 测试云函数
 * @api http://localhost:9000/test1
 * @todo 测试数据库查询
 * 
 */
export default async (event: any, context: any) => {
    console.log("test1-func");

    // 直接使用全局对象
    let list = await Db.query('select * from ct_news');

    if(!list.length){
        return Looplan.result(400,"错误");
    }

    return Looplan.result(200, "test-func1", {
        list: list,
    });
}

云对象

  • functions/TestObj.obj.ts

import { CloudObject } from 'looplan-serverless';
import { Db,getReqId } from 'looplan-orm';
export default class extends CloudObject {

    /**
     * 获取列表
     * @api http://localhost:9000/TestObj.list
     */
    async list() {
        const page: number = this.$event.page || 1;
        const list = await Db.table("ct_test1")
            .field("*")
            .order("id", "desc")
            .paginate(page, 10);
        const reqId = getReqId();
        return Looplan.result(200, "获取成功", {
            reqId: reqId,
            list: list,
            page: page
        });
    }

    async test() {
        return Looplan.result(200, "test", {
            data: "test"
        });
    }
}