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

asai-lua-parse

v0.1.14

Published

asai for you

Readme

asai-lua-parse — Lua 语法解析(luaparse)

包信息

| 建议 npm 名 | 入口文件 | $fn / 注入键 | 类型 | |------------|---------|-------------|------| | @estun/asai-lua-parse | AsaiLuaParse.js | AsaiLuaParse → luaparse API | Feature |

概述

asai-lua-parse 是对 luaparse 的薄桥接层,将 Lua 源码解析为 AST,供编辑器语法校验与结构分析使用。

集成方式

// monorepo — 延迟:lib/featurePlugs.ts
// import AsaiLuaParse from './plugs/asai-lua-parse/AsaiLuaParse.js';
// npm
// import AsaiLuaParse from '@estun/asai-lua-parse';

await ensureFeaturePlug($fn, 'AsaiLuaParse');
$fn.AsaiLuaParse.parse(code, { wait: false, scope: true });

独立性约束

  • 禁止 cross-import 其它 plugs/*(含 asai-lua-format)。
  • 解析与格式化分开注册、分开按需加载。

主要 API / 导出

| 方法 | 说明 | |------|------| | parse(source, options?) | 与 luaparse API 一致 |

options: wait, scope, locations, comments

返回: AST;语法错误抛异常。

性能说明

  • 延迟加载;模块轻量,适合输入防抖后语法检查。
  • 大文件 parse 阻塞主线程,可考虑 Worker 或限制文件大小。
  • 与 format 插件独立 chunk,未使用时不加载。

peerDependencies 建议

{
  "peerDependencies": {},
  "dependencies": {
    "luaparse": "^0.3.0"
  }
}

使用示例

try {
  const ast = $fn.AsaiLuaParse.parse('function foo() end');
  console.log(ast.type); // 'Chunk'
} catch (e) {
  console.error('Lua 语法错误', e);
}

与 asai-lua-format

| | parse | format | |---|-------|--------| | 改源码 | 否 | 是 | | 用途 | 校验、分析 | 美化 |

文件结构

asai-lua-parse/
├── AsaiLuaParse.js    # import luaparse; export default luaparse
└── README.md

主要调用方

cocontrol/.../useLuaEditor.ts

测试

npx tsx --test .youmengyu/test/unit/webclient/plugs/asai-lua-parse/*.test.mjs
# 或包内
npm test --prefix webclient/src/plugs/asai-lua-parse
node .youmengyu/test/asaitest.mjs

入口:package.jsonmain/exports 指向 AsaiLuaParse.js(开发无需先 rollup)。