Roblox.js is a modern open-source NPM package that brings the official Roblox Open Cloud and few others things to JavaScript world with little learning curve. Roblox.js is designed to be as close as possible to native Luau APIs in terms of design, and therefore, making it very easy to transition to.
If you have any feedback that you want to give me, feel free to do so. You can suggest features and report any bugs here or in the GitHub repository. Please also keep in mind that this is my first ever open-source project and therefore, I am not really familiar with NPM, GitHub, Git and other technologies, which were used to make this project possible.
I’m not the best with import things on javascript, and I’m pretty sure you can’t import and require on the same file…
I was wondering, can we require this by chance? I’d love to use this to make my cloud infraction system rather than using a queue system with express that has 4 ban handling servers that use message service to contact the others to send kick requests etc!
Nope, it’s not possible and I am not planning to support require() as it’s thing of a past. You can add such support yourself if you really can’t switch to ES6. If you have anything else to give feedback on, please let me know.
I used async to import it instead, I was about to use it then I got a weird error saying 403, not allowed.
I assume it’s a problem on my end, anyways, I’ll certainly use this in my upcoming roleplay game for a discord bot that checks inventories, stats, etc!
Import and export syntax is not exclusive to TypeScript. The module syntax came in JavaScript (ES6) which was released in 2015. So, no. People do not need to rewrite their JavaScript code into TypeScript code, as it’s not necessary.
The NPM package is indeed written in TypeScript, however it’s transpiled to JavaScript since TypeScript cannot be executed and it only exists for type checking capabilities and for additional syntax features that are not available in JavaScript without cluttering my codebase with code that would somewhat emulate such features (eg. enum).
If you still don’t understand on what I am talking about then I would suggest you to look up and read more about what JavaScript and TypeScript is, and the difference between them so that you have better understanding on this topic.
Support for Roblox inf object has been added to <DataStore>.GetAsync() method, which now returns it as an Infinity object. Previously getting data from a key that contained inf in it’s value would result in JSON parsing error, as mentioned by @Happywalker on GitHub.
HTTPS errors are no longer parsed as strings and instead, they are returned as one object, which contains <HttpsError>.status and <HttpsError>.statusText properties that can be easily accessed by the developer, as requested by @Happywalker on GitHub.
Internal
Added pre-processing function for inf object, which runs right before JSON.parse().
Replaced throw and Error() with Promise.reject() that returns both status code and text in a single object.
For more in-depth changes to the NPM package, visit the history page located in the GitHub repository.