const runner = require('gitlab-runner')
, Client = runner.Client
, Server = runner.Server
new Server().start() // starts a server at port 8080
new Server(9876).start() // starts a server at port 9876
// connects to localhost:8080
const client = new Client('localhost:8080')
// enable logs (for debug only, defaults to false)
client.verbose(true)
// runs 'npm install' on server
client.runCommand('npm install')
// runs every command in 'build.sh' on server
client.runFile('build.sh')
// runs 'rsync' in folder '/var/www' of server
client.runCommand('rsync', '/var/www')
// runs 'git pull' in folder '/var/www/site' of server and prints output to console
client.runCommand('rsync', '/var/www/site', console.log)