@lakutata/netif 3.1.4 → 3.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/README.zh-CN.md +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -25,7 +25,7 @@ npm install @lakutata/netif
|
|
|
25
25
|
"not yet covered by allowScripts": `npm install-scripts approve @lakutata/netif` records that you allow it. Bun and
|
|
26
26
|
pnpm run it only for the dependencies they are told to trust (`trustedDependencies` in the package.json for Bun,
|
|
27
27
|
`pnpm approve-builds` for pnpm); without it, loading the package throws an error telling how to build the addon.
|
|
28
|
-
- Node.js
|
|
28
|
+
- Node.js `>=18.10.0`. The addon uses Node-API, so Bun and the main process of Electron load the addon
|
|
29
29
|
node-gyp built for Node.js, without a rebuild.
|
|
30
30
|
- `@lakutata/core` is a peer dependency, which the package managers install with it: the types of the package refer to
|
|
31
31
|
the contract of the listening on network interfaces that core defines. It is not loaded when the package runs.
|
package/README.zh-CN.md
CHANGED
|
@@ -12,7 +12,7 @@ npm install @lakutata/netif
|
|
|
12
12
|
|
|
13
13
|
- 原生插件在安装时编译(node-gyp),所以机器上需要 Python 3 和支持 C++17 的编译器:macOS 上是 Xcode 的命令行工具,Debian、Ubuntu 上是 `build-essential`,Windows 上是 Visual Studio 生成工具(“使用 C++ 的桌面开发”)。Alpine Linux 还需要内核的头文件:`apk add python3 make g++ linux-headers`。编译失败时,安装也会失败。
|
|
14
14
|
- 包管理器需要执行这个包的安装脚本。npm 会执行,但可能提示这个脚本“not yet covered by allowScripts”:用 `npm install-scripts approve @lakutata/netif` 记下你允许它执行。Bun 和 pnpm 只为信任的依赖执行,需要先允许它(Bun 在 package.json 的 `trustedDependencies` 里加上它,pnpm 用 `pnpm approve-builds`);没有允许时,加载这个包会抛出错误,说明怎样编译原生插件。
|
|
15
|
-
- Node.js
|
|
15
|
+
- Node.js `>=18.10.0`。原生插件用的是 Node-API,所以 Bun 和 Electron 的主进程可以直接加载 node-gyp 为 Node.js 编译的插件,不用重新编译。
|
|
16
16
|
- `@lakutata/core` 是 peer 依赖,包管理器会一起安装:这个包的类型引用了它定义的按网口监听的接口。这个包运行时不会加载它。
|
|
17
17
|
|
|
18
18
|
## 用法
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lakutata/netif",
|
|
3
|
-
"version": "3.1.
|
|
3
|
+
"version": "3.1.5",
|
|
4
4
|
"description": "Listen on a network interface instead of an address: servers of Node.js (http, https, Express, Fastify) and UDP sockets follow an interface whatever its addresses, through their changes and the unplugging of the interface; the interfaces of the machine with their state, and events when they change. A native addon for Linux, macOS and Windows.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"lakutata",
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
"test:electron": "electron test-env/electron/main.mjs"
|
|
64
64
|
},
|
|
65
65
|
"engines": {
|
|
66
|
-
"node": "
|
|
66
|
+
"node": ">=18.10.0"
|
|
67
67
|
},
|
|
68
68
|
"files": [
|
|
69
69
|
"dist",
|
|
@@ -78,6 +78,6 @@
|
|
|
78
78
|
"node-addon-api": "^8.9.2"
|
|
79
79
|
},
|
|
80
80
|
"peerDependencies": {
|
|
81
|
-
"@lakutata/core": "~3.1.
|
|
81
|
+
"@lakutata/core": "~3.1.5"
|
|
82
82
|
}
|
|
83
83
|
}
|