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

luacheck-browserify

v0.10.0

Published

Luacheck in browser

Readme

Luacheck-browserify

npm version License

Luacheck is a static analyzer and a linter for Lua. Luacheck detects various issues such as usage of undefined global variables, unused variables and values, accessing uninitialized variables, unreachable code and more. Most aspects of checking are configurable: there are options for defining custom project-related globals, for selecting set of standard globals (version of Lua standard library), for filtering warnings by type and name of related variable, etc.

Luacheck supports checking Lua files using syntax of Lua 5.1 - 5.4, and LuaJIT. Luacheck itself is written in Lua and runs on all of mentioned Lua versions.

Luacheck-browserify is a fork of Luacheck that has been modified to work in browser environments. The Lua code is executed using Wasmoon. Luacheck-browserify can also be specifically configured to check Lua modules in MediaWiki sites.

Contents

Installation

Using CDN

As a NPM package, Luacheck-browserify can be included in a project using a CDN. Add the following script tag to the HTML file:

<script src="https://cdn.jsdelivr.net/npm/luacheck-browserify"></script>

or

<script src="https://unpkg.com/luacheck-browserify"></script>

Basic usage

After Luacheck-browserify is installed, a global async function luacheck is available. The luacheck function takes a required second argument which is one of the following:

const Luacheck = luacheck('max');
const Luacheck = luacheck({
	globals: ['foo', 'bar'],
	read_globals: ['baz'],
});
const Luacheck = luacheck({std: 'max'});

In addition to the standard globals provided by Luacheck (e.g., lua53 for Lua 5.3), Luacheck-browserify also supports mediawiki for MediaWiki-specific globals implemented in the Scribunto extension.

The luacheck function returns a class instance with an async queue method that can be called with a string of Lua code to check. The queue method returns a promise that resolves with an array of warnings.

const Luacheck = luacheck('max');
console.log(await Luacheck.queue('local a, b, c = nil'));

Otherwise, the luacheck.check function can be called with a string of Lua code and specified standard globals or Luacheck configuration object to return a promise that resolves with an array of warnings.

console.log(await luacheck.check('local a, b, c = nil', 'lua55c'));
console.log(await luacheck.check('local a, b, c = nil', {
	globals: ['foo', 'bar'],
	read_globals: ['baz'],
}));
console.log(await luacheck.check('local a, b, c = nil', {std: 'lua55c'}));

The warnings are objects with the following properties:

interface {
	line: number;
	column: number;
	end_column: number;
	code: string;
	msg: string;
	/** 0: info, 1: warning, 2: error */
	severity: 0 | 1 | 2;
}

For more info about the warnings, see Luacheck documentation.

Related projects

Editor support

There are a few plugins which allow using Luacheck directly inside an editor, showing warnings inline:

Documentation

Luacheck Documentation is available online.