@srcds/log-receiver
v0.1.0
Published
Receiver of SRCDS logs
Downloads
5
Readme
Receiver of SRCDS logs
Installation
Node.js 14.0.0 or newer is required
Yarn
yarn add @srcds/log-receiver
NPM
npm i @srcds/log-receiver
Example usage
import { SrcdsLogReceiver } from '@srcds/log-receiver';
const receiver = new SrcdsLogReceiver({
// hostname: '0.0.0.0',
// port: 9871,
// onlyRegisteredServers: false
});
receiver.addServers({
hostname: '127.0.0.1',
port: 27015,
// password: '1234'
});
receiver.on('log', (log) => {
console.log('Log', log);
});
receiver.on('error', (error) => {
console.log('error', error);
});
async function run() {
await receiver.listen();
console.log('Server running');
}
run().catch(console.log);