JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 188998
  • Score
    100M100P100Q173828F
  • License MIT

Helper library for node-rs

Package Exports

  • @node-rs/helper
  • @node-rs/helper/lib/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@node-rs/helper) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

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