Documentation
Documentation is available at https://cxmeel.github.io/dump-parser.
Quick Start
DumpParser is available via Wally, GitHub and the Roblox Creator Marketplace.
Wally
Refer to the wally package entry for the latest version number.
# wally.toml
[dependencies]
DumpParser = "csqrl/dump-parser@X.X.X"
Manual Installation
Grab a copy from the Roblox Creator Marketplace (Toolbox), or download the latest binary from the GitHub repo and drop it into Studio.
Basic Examples
Below is a small showcase of some of the basic features of DumpParser. Please refer to the docs for more information on the full API and all features available.
Create a new DumpParser
There are two methods to create a new DumpParser Instance. The first, and simplest, is to fetch the latest API dump (for your current Roblox version*) from Roblox’s servers.
*This means the API dump will always match your current version if you’re running a beta or outdated build of Studio, for example.
local DumpParser = require(path.to.DumpParser)
local Dump = DumpParser.fetchFromServer()
Promisified constructor
To work with DumpParser asynchronously, you could wrap fetchFromServer
in a Promise:
local DumpParser = require(path.to.DumpParser)
local Promise = require(path.to.Promise)
local fetchDumpFromServer = Promise.promisify(DumpParser.fetchFromServer)
fetchDumpFromServer():andThen(function(Dump)
-- do stuff with the Dump
end)
You can also bring your own API dump. DumpParser expects you to have already JSON-decoded the data before supplying it to the constructor. DumpParser doesn’t care where or how you obtain the API dump, as long as it’s in the same format as the official API dump (for example, you might pull it from the Roblox-Client-Tracker repo).
local myDump = ... -- It doesn't matter how you obtain the dump
local Dump = DumpParser.new(myDump)
Get Properties of an Instance
Getting properties of an Instance is really simple! The result is a table of properties, where the key is the name of the property, and the value is the related metadata from the dump.
You might use this to store the properties in a table:
local myPart = workspace.Part
local partProperties = Dump:GetProperties(myPart)
local properties = {}
for propertyName in partProperties do
properties[propertyName] = myPart[propertyName]
end
Alternatively, you can pull only the properties that have been modified from their default values:
local myPart = workspace.Part
local partProperties = Dump:GetChangedProperties(myPart)
local properties = {}
for propertyName in partProperties do
properties[propertyName] = myPart[propertyName]
end
Filters
DumpParser contains a powerful filters feature, which allows refining class and class member search results down to a specific criteria. Filters can be used almost anywhere throughout the DumpParser.
Please refer to the docs to see all the methods where filters can be used.
local services = Dump:GetClasses(Dump.Filter.Service)
This would result in a table where the key is the service name, and the value is the service metadata. This could also be flipped to exclude services:
local nonServices = Dump:GetClasses(
Dump.Filter.Invert(Dump.Filter.Service)
)
Filters can also be stacked to provide further refinement. For example, internally :GetProperties
uses the following filters:
local properties = class:GetProperties(
Filter.Invert(Filter.Deprecated),
Filter.HasSecurity("None"),
Filter.Scriptable
)
Which returns all properties that are not deprecated, have no read/write security, and can be accessed by scripts. This could be further filtered by using Filter.Invert(Filter.ReadOnly)
to exclude read-only properties.
By default, a class or member must match all filters in order to be included in the results; however, using Filter.Any
combines filters so that classes/members only need to pass one of the filters to be included:
local properties = class:GetProperties(
Filter.Invert(Filter.Deprecated),
Filter.HasSecurity("None"),
Filter.Scriptable,
Filter.Invert(Filter.ReadOnly),
Filter.Any(
Filter.ValueType("Color3"),
Filter.ValueType("BrickColor")
)
)
This would return all properties who:
- Are not deprecated
- Have no read/write security
- Are accessible to scripts
- Are not read-only
- Accepts a
Color3
orBrickColor
as its value