1 | # `@node-rs/helper`
|
2 |
|
3 | > Helper library for node-rs
|
4 |
|
5 | ## Usage
|
6 |
|
7 | ### locateBinding
|
8 |
|
9 | Load native binding file from `dirname`
|
10 |
|
11 | ```ts
|
12 | locateBinding(dirname: string): string
|
13 | ```
|
14 |
|
15 | - `dirname`, dirname which the **.node** binding file located
|
16 | - return the full path of the binding file, throw if file not existed or platform not supported
|
17 |
|
18 | ```ts
|
19 | const { locateBinding } = require('@node-rs/helper')
|
20 |
|
21 | module.exports = require(locateBinding(__dirname))
|
22 | ```
|