I’ve uploaded a small package to npm to help with loading your .glitch-assets
file into a data structure in your program.
There are mainly three things about the .glitch-assets
file that this package abstracts for you. It’ll return you JS object with each asset keyed using it’s uuid
. The three main things the package helps with is:
- each asset is a JSON structure on a line of it’s own (the file isn’t just one big JSON file)
- each deleted asset is an extra line in the file just specifying the
uuid
and that it has been deleted - presumably because each action in the Glitch editor just appends an action to this file rather than modifies it - there is always a newline at the end of the file, so the final line (if splitting on newlines) is blank, so this is also catered for
You can use either callbacks or promises with the function call API.
Please let me know if you like it or if you have any problems or feature requests. Thanks for any feedback.