MTA:SA SDK for Node.js
Lightweight module to simplify integration of external apps with MTA:SA servers. Uses the standard HTTP call interface, which you can learn more about here.
npm install mtasa --save
const Client = Client;
Then create a new client instance and use it to make some remote calls:
// Setup a new client for local server;// Perform calls using async/await:// Without async/await, plain old Promises:mta.resources.test_resource.testProcedure.then.catch;
For more information on how to expose your MTA server APIs (like the
testProcedure function from
test_resource resource) over the web interface, refer to Resource Web Access wiki page.
The source code has inline documentation, which is also included in typings (
new Client( at the very end and hit
CTRL + Shift + Space if the popup didn't appear automatically already.
You can also jump straight into the source code of the library and unit tests.
This library is totally usable but is perhaps still lacking some features, hence the 0.1.x version. I consider it stable for my own needs. Feel free to report bugs or feature requests here. PRs welcome too.