Skip to content

Instantly share code, notes, and snippets.

@satori99
Last active June 22, 2021 10:34
Show Gist options
  • Save satori99/6e901af9bfae3a0d6ca51e6ce5a4793f to your computer and use it in GitHub Desktop.
Save satori99/6e901af9bfae3a0d6ca51e6ce5a4793f to your computer and use it in GitHub Desktop.
castapp
#!/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 )
{
"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