import { createConnection , connect , Socket } from "net" ; import * as minimist from 'minimist' ; import defaults from './defaults' ; const args = minimist ( process . argv . slice ( 2 ) ) ; const host = args . host || defaults . host ; const port = Number ( args . port ) || defaults . port ; const message = args . msg ; const client = connect ( { host , port } , ( ) => { console . log ( 'Adobe Broadcast connected' ) ; } ) ; client . setEncoding ( 'utf8' ) ; client . on ( 'error' , ( error ) => { console . error ( `Adobe Broadcast error: ${ JSON . stringify ( error ) }` ) ; } ) ; client . write ( message , ( ) => { process . exit ( ) ; } ) ;