Skip to content

Commit 812a09a

Browse files
committed
Add sample script for connection
The fact that stdout could be asynchronous concerns process.exit, but it should be OK except for Windows. nodejs/node#11568
1 parent 80d3585 commit 812a09a

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

oneshots/connectionTemplate.ts

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import { connect } from "common"
2+
3+
const main = async () => {
4+
const api = await connect("endpoint", false)
5+
api.isReady // do something
6+
}
7+
8+
main()
9+
.then(() => process.exit())
10+
.catch((e) => {
11+
console.error(e)
12+
process.exit(1)
13+
})

0 commit comments

Comments
 (0)