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

node-lua-runner

v2.0.1

Published

Embed Lua 5.1 in Node.js. Lua and LuaFileSystem are compiled into the addon, so there is nothing to install on the system.

Readme

node-lua-runner

Embed Lua 5.1 in your Node.js programs.

Lua and LuaFileSystem are compiled directly into the addon, so there is no system Lua to install and nothing to configure — npm install builds everything from source on Linux, macOS and Windows, on both x64 and ARM64.

Installation

npm install node-lua-runner

The addon is compiled at install time, so you need a working C/C++ toolchain:

  • Linuxbuild-essential (or your distribution's equivalent) and Python 3
  • macOS — the Xcode Command Line Tools (xcode-select --install)
  • Windows — the "Desktop development with C++" workload from Visual Studio Build Tools

Nothing else. Node.js 18 or newer.

If the install fails, see troubleshooting — the common ones are Visual Studio 2026 on Windows and npm 12 blocking build scripts.

Quick start

const nodelua = require('node-lua-runner');

const lua = new nodelua.LuaState();

lua.DoString('print("Hello from Lua!")');

// Expose a JavaScript function to Lua
lua.RegisterFunction('add', function () {
	const a = lua.ToValue(1);
	const b = lua.ToValue(2);
	lua.Pop(2);
	lua.Push(a + b);
	return 1;
});

lua.DoString('print("2 + 3 = " .. add(2, 3))');

lua.Close();

Documentation

Examples

How it works

Built on the Lua 5.1 C API through Node-API, which is ABI-stable — a compiled build keeps working across future Node.js releases instead of breaking on each major version.

The API is low-level and maps closely onto the C API, and it is synchronous throughout.

Descended from NodeLua and node-luajit.

Caveats

This is a thin wrapper over the Lua C API, and it does not shield you from every way of misusing it. Some stack operations on a value of an unexpected type raise an unprotected Lua error, which aborts the process rather than throwing a JavaScript exception. SetField and GetField guard against this; other methods do not. Keep track of what is on the stack — see stack indices.

License

ISC — see LICENSE. The vendored Lua and LuaFileSystem sources are MIT; their notices are in THIRD-PARTY-NOTICES.md.