Last active
June 22, 2021 10:34
-
-
Save satori99/6e901af9bfae3a0d6ca51e6ce5a4793f to your computer and use it in GitHub Desktop.
castapp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env node | |
import castv2 from 'castv2' | |
console.debug( 'app.js !!!' ) | |
const address = process.argv[ 2 ] | |
const client = new castv2.Client() | |
await new Promise( ( resolve, reject ) => { | |
client.once( 'error', reject ) | |
client.connect( address, () => { | |
client.off( 'error', reject ) | |
resolve() | |
} ) | |
} ) | |
console.info( 'connected', address ) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name" : "castapp", | |
"version" : "1.0.0", | |
"type": "module", | |
"bin":"./app.mjs", | |
"dependencies": { | |
"castv2": "^0.1.10" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment