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

lc-scripts

v1.2.4

Published

低代码平台命令包

Downloads

81

Readme

lowcode-scripts

这是一个用于低代码平台开发的脚本集合,旨在简化资产处理、本地模式开发和发布流程。

脚本功能

processAssets.js

  • 功能: 递归遍历指定目录(默认为 public/dev),收集所有文件路径,并将这些相对路径作为 JavaScript 数组写入 config/localAssets.ts 文件。
  • 用途: 用于生成本地资产清单,方便在开发环境中模拟线上资源。
  • 执行方式:
    • 通过 npm run lc-process-assets 命令执行。
    • 或者在全局安装后,直接运行 lc-process-assets 命令。

downloadAssets.js

  • 功能: 从 OSS (Object Storage Service) 下载 config/localAssets.ts 中配置的资产文件到本地指定目录(默认为 public/dev)。
  • 用途: 用于在本地开发环境中同步线上资产,确保开发环境与生产环境一致。
  • 执行方式:
    • 通过 npm run lc-download-assets 命令执行。
    • 或者在全局安装后,直接运行 lc-download-assets 命令。

localSchema.js

  • 功能: 从 OSS 下载 schema 数据,并将其写入本地文件。
  • 用途: 用于本地开发时获取最新的组件或页面 schema 定义。
  • 执行方式:
    • 通过 npm run lc-local-schema 命令执行。
    • 或者在全局安装后,直接运行 lc-local-schema 命令。

renameJsonToJs.js

  • 功能: 将指定目录下的 .json 文件重命名为 .js 文件。
  • 用途: 可能用于处理某些需要将 JSON 数据作为 JavaScript 模块导入的场景。
  • 执行方式:
    • 通过 npm run lc-rename-json-to-js 命令执行。
    • 或者在全局安装后,直接运行 lc-rename-json-to-js 命令。

npm 发布

要将此项目发布到 npm 仓库,请遵循以下步骤:

  1. 准备 npm 账户

    • 如果您还没有 npm 账户,请先在 npm 官网 注册。
    • 在命令行中运行 npm login 登录您的账户。
  2. 更新 package.json

    • 确保 package.json 中的以下字段已正确配置:
      • name: 包名(必须唯一)
      • version: 遵循语义化版本控制 (semver),例如 1.0.0
      • description: 清晰的包描述
      • main: 主入口文件,例如 index.js (如果适用)
      • bin: 命令行工具配置,例如:
        "bin": {
            "lc-process-assets": "bin/processAssets.cmd",
            "lc-download-assets": "bin/downloadAssets.cmd",
            "lc-local-schema": "bin/localSchema.cmd",
            "lc-rename-json-to-js": "bin/renameJsonToJs.cmd"
        }
      • keywords: 相关关键词,有助于用户搜索
      • repository: 代码仓库信息
      • license: 许可证类型,例如 MIT
  3. 测试本地安装 在发布之前,建议在本地测试包的安装和功能:

    npm install -g .

    安装后,测试所有命令(如 lc-process-assets)是否正常工作。

  4. 发布到 npm 当您准备好发布时,运行以下命令:

    npm publish

    如果您的包是私有的,或者您想限制访问,可以使用:

    npm publish --access=restricted
  5. 更新版本(后续更新时) 每次发布新版本时,您都需要更新 package.json 中的 version 字段。可以使用 npm version 命令来自动化此过程:

    npm version patch   # 增加补丁版本号,例如 1.0.0 -> 1.0.1
    # npm version minor # 增加次版本号,例如 1.0.0 -> 1.1.0
    # npm version major # 增加主版本号,例如 1.0.0 -> 2.0.0
    npm publish

最佳实践建议

  • .npmignore 文件: 创建一个 .npmignore 文件来排除不需要发布到 npm 的文件和目录(例如 node_modules、测试文件、文档等),这有助于减小包的体积。
  • prepublishOnly 脚本: 考虑在 package.json 中添加 prepublishOnly 脚本,用于在发布前运行测试或构建步骤,确保发布的代码是高质量的。
  • npm pack: 在发布前运行 npm pack 命令,它会创建一个 .tgz 文件,您可以检查这个文件来确认最终发布包中包含了哪些内容。