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

@nodecraft/lua-ast

v0.9.0

Published

JavaScript parser/runner/generator for Lua using the luaparse library

Readme

Lua-AST

Lua parser and generator written in Typescript.

USAGE

Basic parsing:

import { getOriginalBase, parse, update } from 'lua-ast';

const data = getOriginalBase();

const chunk = parse('example=1');

Execution is limited to 1,000 steps by default. Configure the budget when creating execution data, or pass the same options to update:

const data = getOriginalBase({ maxSteps: 10_000 });
update(chunk, globals, { maxSteps: 10_000 });

Statements, loop iterations, and Lua function calls consume steps. Exceeding the budget throws ExecutionLimitError.

Getting globals from a script: Chunk.execute(data)

chunk.execute(data);
// data.globals === { example: 1 }

Getting the generated script: Chunk.toString()

chunk.toString()
//=> 'example = 1'

Setting a value on a global: Chunk.set(var, data) var needs to be a string data can be a Map, string, number, or boolean.

chunk.set('example', new Map([[1, 2]]))
chunk.execute(data);
// data.globals === { example: Map { 1 => 2 } }
chunk.toString()
/*=>
example =
{
  2
}*/

Setting a value on a table: Chunk.set([var, ...property], data) property is a string that represents the path through the var to get to the location to set. the last property can be the empty string in order to to append a value to the current table.

BUG: you currently can't use this on a variable that isn't already defined as a table.

chunk.set(['example', ''], 4)
chunk.execute(data);
// data.globals === { example: Map { 1 => 2, 2 => 4 } }
chunk.toString()
/*=>
example =
{
  2,4
}*/

Deleting a global variable: Chunk.delete(var)

data.globals = {};
chunk.delete('example');
chunk.execute(data);
// data.globals === { }
chunk.toString();
/*=> ''*/

Deleting a value on a table: Chunk.delete([var, ...property], data?) property is a string that represents the path through the var to get to the location to delete. the last property can be the empty string in order to match a value corresponding to data.

chunk.set('example', new Map([['test', 'thing'], ['thing', 'test']]));
chunk.execute(data);
// data.globals === { example: Map { 'test' => 'thing', 'thing' => 'test' } }
chunk.delete(['example', 'test']);
chunk.execute(data);
// data.globals === { example: Map { 'thing' => 'test' } }
chunk.delete(['example', ''], 'test');
chunk.execute(data);
// data.globals === { example: Map {} }

Updating values en-masse: LAST.update(chunk, globals)

data.globals = {};
update(chunk, {
  execute: true
});
chunk.execute(data);
// data.globals === { execute: true }