npm.io
1.6.1 • Published 1 week ago

@node-rs/helper

Licence
MIT
Version
1.6.1
Deps
1
Size
5 kB
Vulns
0
Weekly
0
Stars
1.5K

@node-rs/helper

install size Downloads

Helper library for load native package.

Usage

locateBinding

Load native binding file from dirname

loadBinding(dirname: string, filename?: string = 'index', packageName?: string): string
  • dirname, dirname which the .node binding file located

  • filename, the napi.name filed in you package.json

  • packageName, the name filed in your package.json, @swc/core for example.

  • return native module

const { loadBinding } = require('@node-rs/helper')

module.exports = loadBinding(__dirname, 'swc', '@swc/core')

Keywords