@node-rs/helper
TypeScript icon, indicating that this package has built-in type declarations

1.6.0 • Public • Published

@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')

Dependencies (1)

Dev Dependencies (0)

    Package Sidebar

    Install

    npm i @node-rs/helper

    Weekly Downloads

    232,664

    Version

    1.6.0

    License

    MIT

    Unpacked Size

    5.53 kB

    Total Files

    7

    Last publish

    Collaborators

    • dxd_sjtu
    • broooooklyn