rbxlx-parser

1.0.1 • Public • Published

rbxlxparser

Rbxlx - A .rbxlx file parser for NodeJS

Credits

Originally created and opensourced by Jhxan on the Roblox Developer Forum. RAMPAGE Interactive has forked it for GitHub usage and contributions to the code.

Original article: https://devforum.roblox.com/t/rbxlx-a-rbxlx-file-parser-for-nodejs/488977

NPM Package

Coming soon..

Usage

const rbxlx = require("./index.js");
const util = require("util");
const path = require("path");
const fs = require("fs");

rbxlx.parse(fs.readFileSync(path.join(__dirname, "test.rbxlx")))
.then(tree => {
    console.log("Parsed file!");

    var descendants = tree.getDescendants();
    for (var object of descendants) {
        if (object.class == "Part") {
            console.log("We found a Part named", object.getProperty("Name"));
        }
    }

    // You can also output the entire tree structure
    //console.log(util.inspect(tree, {depth: Infinity, colors: true}));
})
.catch(err => {
    console.log(`Could not parse file because: ${err.message}`);
})

Readme

Keywords

none

Package Sidebar

Install

npm i rbxlx-parser

Weekly Downloads

0

Version

1.0.1

License

MIT

Unpacked Size

7.02 kB

Total Files

8

Last publish

Collaborators

  • vq9o