index.js 602 B

1234567891011
  1. const { loadBinding } = require('@node-rs/helper')
  2. /**
  3. * __dirname means load native addon from current dir
  4. * 'package-template' means native addon name is `package-template`
  5. * the first arguments was decided by `napi.name` field in `package.json`
  6. * the second arguments was decided by `name` field in `package.json`
  7. * loadBinding helper will load `package-template.[PLATFORM].node` from `__dirname` first
  8. * If failed to load addon, it will fallback to load from `@napi-rs/package-template-[PLATFORM]`
  9. */
  10. module.exports = loadBinding(__dirname, 'package-template', '@napi-rs/package-template')