Node.js version of OpenTTDLib
This is a node.js version of OpenTTDLib. With it you can extract information from a OpenTTD server.
It is tested with the latest stable version of OpenTTD (1.5.3).
npm install -g nodejs_openttdlib
nottdlib [options]
Options:
-h, --help output usage information
-V, --version output the version number
-p, --port <n> Specify port
-h, --host <n> Specify host
-i, --info Get server info
-d, --details Get detailed server info
npm install nodejs_openttdlib
const nottdlib = require('nodejs_openttdlib');
// promises
nottdlib.getServerInfo()
.then((info) => {
console.log(info);
})
.catch((err) => {
console.error(err);
});
// callbacks
nottdlib.getServerDetail((err, details) => {
if( err ) {
console.error(err);
return;
}
console.log(details);
});
GPL-2.0