update
This commit is contained in:
parent
fa3715c748
commit
657d47722f
3
index.js
3
index.js
@ -1,10 +1,11 @@
|
||||
const path = require('path')
|
||||
const { loadBinding } = require('@node-rs/helper')
|
||||
|
||||
try {
|
||||
// __dirname means load native addon from current dir
|
||||
// 'index' means native addon name is `index`
|
||||
// the value of this two arguments was decided by `build` script in `package.json`
|
||||
module.exports = loadBinding(__dirname, 'index')
|
||||
module.exports = loadBinding(path.join(__dirname, '..', `rs-diff-${process.platform}`), 'index')
|
||||
} catch (e) {
|
||||
try {
|
||||
module.exports = require(`@swc-node/core-${platform()}`)
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "rs-diff-darwin",
|
||||
"version": "0.0.1",
|
||||
"version": "0.0.2",
|
||||
"description": "Template project for writing node package with napi-rs",
|
||||
"repository": "https://git.trj.tw/nodejs/rs-diff.git",
|
||||
"license": "MIT",
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "rs-diff-linux",
|
||||
"version": "0.0.1",
|
||||
"version": "0.0.2",
|
||||
"description": "Template project for writing node package with napi-rs",
|
||||
"repository": "https://git.trj.tw/nodejs/rs-diff.git",
|
||||
"license": "MIT",
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "rs-diff",
|
||||
"version": "0.0.1",
|
||||
"version": "0.0.2",
|
||||
"description": "Template project for writing node package with napi-rs",
|
||||
"author": "Jay <jay@trj.tw>",
|
||||
"main": "index.js",
|
||||
@ -58,7 +58,7 @@
|
||||
}
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"rs-diff-darwin": "^0.0.1",
|
||||
"rs-diff-linux": "^0.0.1"
|
||||
"rs-diff-darwin": "^0.0.2",
|
||||
"rs-diff-linux": "^0.0.2"
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user