napi-rs/examples/napi/__test__/worker.js

8 lines
186 B
JavaScript
Raw Normal View History

const { parentPort } = require('worker_threads')
const native = require('../index')
parentPort.postMessage(
native.Animal.withKind(native.Kind.Cat).whoami() + native.DEFAULT_COST,
)