napi-rs/examples/napi-compat-mode/__tests__/napi4/tsfn-dua-instance.js
forehal a781a4f27e feat(cli): brand new cli tool with both cli and programmatical usage (#1492)
BREAKING CHANGE: requires node >= 16 and some cli options have been renamed
2023-04-06 11:04:53 +08:00

19 lines
331 B
JavaScript

const bindings = require('../../index.node')
async function main() {
await Promise.resolve()
const a1 = new bindings.A((err, s) => {
console.info(s)
a1.unref()
})
const a2 = new bindings.A((err, s) => {
console.info(s)
a2.unref()
})
a1.call()
a2.call()
}
main().catch((e) => {
console.error(e)
})