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 🙏

© 2024 – Pkg Stats / Ryan Hefner

simple-luau-disassembler

v1.0.6

Published

Simple disassembler for the Luau programming language

Downloads

382

Readme

Simple Luau Disassembler (.js)

Provides a function to produce a dump of Luau (0.620) instructions as a string

Supported Platforms

This library was created without the intent of being widely used, so currently the only supported platform is Windows (my personal machine).

If you need additional platform support, feel free to submit an issue on this repo and I'll get to it asap.

Example

Disassembling Scripts

This Javascript code

import disassembler from "simple-luau-disassembler";

const { disassemble } = disassembler;

disassemble("print'hi'");

produces this output

[__unnamed_function__]
GETIMPORT R0 1 [print]
LOADK R1 K2 ['hi']
CALL R0 1 0
RETURN R0 0

Disassembling Bytecode

import disassembler from "simple-luau-disassembler";

const { disassembleBytecode } = disassembler;

const bytecode = await readFile("path/to/your/binary/bytecode/file");

disassembleBytecode(bytecode);
[__unnamed_function__]
GETIMPORT R0 1 [print]
LOADK R1 K2 ['hello world']
CALL R0 1 0
RETURN R0 0

Disassembling Bytecode (Encoded)

Bytecode versions from the Roblox client have encoded instructions; to support this behavior, pass in the "roblox" flag into the second parameter of disassembleBytecode

import disassembler from "simple-luau-disassembler";

const { disassembleBytecode } = disassembler;

const bytecode = await readFile("path/to/roblox/encoded/bytecode/file");

disassembleBytecode(bytecode, "roblox");
[__unnamed_function__]
GETIMPORT R0 1 [print]
LOADK R1 K2 ['Hello world!']
CALL R0 1 0
RETURN R0 0

Build Instructions

After forking/cloning

cd simple-luau-disassembler.js

Install node-gyp

npm i -g node-gyp

Run node-gyp's configure command (any errors will help you find out what build tools you need, if you don't have them already)

node-gyp configure

After resolving errors, you should be able to run the build command just fine

node-gyp build

This will create a new build directory in which the binary .node file is located, which is what you're going to use when calling require or import