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

@friday-friday/luaparse

v0.3.0

Published

A Lua parser in JavaScript with unist-compatible AST output

Readme

luast

A Lua parser and syntax tree ecosystem for JavaScript, built on unist.

Packages

This repository contains luaparse and its ecosystem of packages for the unified / syntax-tree pipeline:

| Package | Description | Status | | -------------------------- | ------------------------------------------ | ------------------------------------------------------------------------ | | @friday-friday/luast | Tree specification and TypeScript types | packages/luast | | @friday-friday/luast-util-from-luaparse | Convert legacy luaparse AST → luast | packages/luast-util-from-luaparse | | @friday-friday/luast-util-visit | Tree visitor for luast (named-field aware) | packages/luast-util-visit | | @friday-friday/luast-util-scope | Scope analysis over luast trees | packages/luast-util-scope | | @friday-friday/unified-lua | unified parser plugin for Lua | packages/unified-lua | | @friday-friday/luaparse | Lua parser with native luast emission | v0.1.0 |

Documentation

  • LUAST-SPEC.md — The luast tree specification. Defines every node type, the content model, the child-field registry, and the position format. This is the primary contract for the ecosystem.

  • MIGRATION-PLAN.md — The phased migration plan. Covers design decisions with rationale, package architecture, the six implementation phases, risk assessment, and resolved design questions.

  • PORT-ANALYSIS.md — The original gap analysis. Documents the structural differences between the current luaparse AST and what unist requires. Written before the spec and plan; superseded by them on any point of conflict.

Usage

// ESM
import luaparse from '@friday-friday/luaparse'

// Emit a luast (unist-compliant) tree
const tree = luaparse.parse('local x = 1', {ast: 'luast'})
// tree.type === 'root', tree.body[0].type === 'localStatement'

// Legacy mode (default, backwards compatible)
const legacy = luaparse.parse('local x = 1')
// legacy.type === 'Chunk', legacy.body[0].type === 'LocalStatement'
// unified pipeline
import {unified} from 'unified'
import luaParse from '@friday-friday/unified-lua'

const tree = unified().use(luaParse, {luaVersion: '5.3'}).parse('local x = 1')

Quick orientation

If you want to understand the tree format, read LUAST-SPEC.md.

If you want to understand the migration history, read MIGRATION-PLAN.md.

If you want the original gap analysis, read PORT-ANALYSIS.md.

If you want the legacy v0.x documentation, see README.legacy.md.

Design summary

luast follows the esast precedent — the only programming-language AST in the unist ecosystem. Key choices:

  • Named fields, not childrencondition, body, left, right etc. are the canonical structural fields. A dedicated luast-util-visit handles traversal. Generic unist-util-is and unist-util-position work unchanged.
  • root as root type — not Chunk, for unist consistency.
  • camelCase type namesifStatement, binaryExpression, matching the ecosystem majority.
  • Scope analysis as a separate utility — not baked into the parser.
  • Comments on root only — in root.comments, following esast convention.

Ecosystem context

luast sits alongside other language-specific unist implementations:

Remaining work

The following items from MIGRATION-PLAN.md are deferred:

  • Phase 5: luast-util-attach-comments — comment-to-node mapping utility (optional, low priority)
  • Phase 6: Drop legacy browser build — or produce it as a build artifact

Acknowledgements

This project is a rewrite and ecosystem extension of luaparse, originally created by Oskar Schöldström (oxy.fi) as part of his bachelor's thesis at Arcada University of Applied Sciences.

The core parser (luaparse.js) retains substantial portions of the original luaparse codebase. The unist-compliant luast ecosystem — the tree specification, utilities, and unified plugin — is new work by Eric Friday.

For the original luaparse documentation, see README.legacy.md.

Original acknowledgements

The original luaparse project acknowledged the following:

  • Initial tests scaffolded from yueliang and manually checked for errors.
  • Much of the code based on LuaMinify, the Lua source, and Esprima.
  • luamin, a Lua minifier by Mathias Bynens.
  • Ace, an online code editor.

License

MIT — Copyright (c) Oskar Schöldström 2012–2014 (original luaparse). Copyright (c) Eric Friday 2025 (luast ecosystem and rewrite).