
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
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
Import the Client class:
TypeScript:
import { Client } from "mtasa";
JavaScript:
const Client = require('mtasa').Client;
Then create a new client instance and use it to make some remote calls:
// Setup a new client for local server
const mta = new Client("127.0.0.1", 22005, "root", "pass");
// Perform calls using async/await:
(async () => {
try {
// Call some procedure
const result = await mta.resources.test_resource.testProcedure("some param");
// Call a procedure (the alternative verbose API)
const verboseCallResult = await mta.call("test_resource", "testProcedure", "some param", 1234);
} catch (err) {
console.error(`Ooops! Something went wrong ${err}`);
}
})()
// Without async/await, plain old Promises:
mta.resources.test_resource.testProcedure()
.then((result) => {
console.log(result);
})
.catch((err) => {
console.error(`Ooops! Something went wrong ${err}`);
});
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 (.d.ts) shipped with the module. This means that no matter if you write plain old JavaScript or TypeScript - as long as you use some decent editor with intellisense (like Visual Studio Code), you should get nice autocompletion and feedback with documentation. Just give it a try yourself - use one of the examples above, type 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.
MIT
FAQs
mtasa
We found that mtasa demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.