Git Product home page Git Product logo

rbxlx's Introduction

Parsing .rbxlx files can be difficult to do using NodeJS since there are no libraries currently available for that, until now.

So what is it?

Simply put, it parses .rbxlx files (not .rbxl) in an organised manner. This can be useful in many ways and I personally use it to convert the files to objects where I then can for example find all the scripts with a specific name.

There are of course many others ways you can use this and one is for example importing a place file, changing the Color3 of all frames to something that you retrieved from an api and then importing it back to Roblox.

What does parsing mean?

It simply means that we break down the file into a more user friendly structure that is easier to work with than traditional xml files.

How do I use it?

This is a basic example on how to use it, in this case we parse a .rbxlx file and then output every Part in that file.

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}`);
})

How do I import those instances?

You can use this module, if you want a demo on how to use it then check out this place.

Feedback

The parser isn't perfect so if you have any general feedback on it or the module then feel free to contact me!

rbxlx's People

Contributors

isemil avatar

Watchers

 avatar

rbxlx's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.