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

@cloudbase/lcap-business-sdk

v1.7.1

Published

云开发低码行业SDK

Readme

云开发低码行业SDK

快速开始

安装:

npm install lcap-business-common

在行业模板数据源中的某个方法中使用:

const Joi = require('joi');
const { LcapContainer } = require('lcap-business-common');

async function main(params, context) {
    // 1. 初始化容器
    const { services } = new LcapContainer({
        lcDatasourceCtx: context,
    });
    // 2. 访问常用的模块,以及其上的方法和对象
    const { tcbService: { db }, utilService } = services;

    // 3. 使用:校验转换数据源入参
    const schema = Joi.object({
        _id: Joi.string().valid().required(),
    });
    const validParams = utilService.checkParams(params || {}, schema);

    // 4. 使用:读取数据源底层数据表数据
    const col = db.collection('lcap-business-edu-practice');
    return await col.where({}).get()
}

module.exports = main;

本地开发

本地开发分为 2 部分:

  • 数据源方法:只单纯地使用 lcap-business-common 库来快速开发行业模板数据源逻辑
  • lcap-business-common 库:除了开发行业逻辑,提炼公共模块/方法,可供其他行业复用

开发数据源方法

为了能在本地运行数据源方法的代码,看到效果。需要改造下快速开始部分的代码。

main() 定义后,新增代码:

/**
 * 本地测试逻辑
 */
if ((new LcapContainer()).services.configService.isLocalDev()) {
  main({
    _id: 'cbddf0af60e56bf01549e96323e81845',
  }).then((res) => {
    console.log('>>> res is', res);
  });
}

本地通过 Node.js 执行文件数据源方法文件即可看到效果。

开发 lcap-business-common 库

请使用 npm link 方式进行开发。请参考 如何在本地调试 npm 包

更多内容

请参考docs