njs-modbus 3.4.0 → 4.0.0

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/package.json CHANGED
@@ -1,91 +1,95 @@
1
1
  {
2
2
  "name": "njs-modbus",
3
- "version": "3.4.0",
4
- "description": "A pure JavaScript implementation of Modbus for Node.js.",
3
+ "version": "4.0.0",
4
+ "description": "A zero-dependency Modbus protocol library for Node.js with TCP, RTU, ASCII, UDP, and TLS support.",
5
5
  "keywords": [
6
6
  "modbus",
7
+ "tcp",
7
8
  "rtu",
8
9
  "ascii",
9
- "serial",
10
- "tcp",
10
+ "tls",
11
11
  "udp"
12
12
  ],
13
- "homepage": "https://github.com/xiejay97/njs-modbus/tree/main#readme",
14
- "bugs": {
15
- "url": "https://github.com/xiejay97/njs-modbus/issues"
16
- },
13
+ "author": "Xie Jay <xiejay97@gmail.com>",
14
+ "license": "BUSL-1.1",
15
+ "homepage": "https://github.com/xiejay97/njs-modbus#readme",
17
16
  "repository": {
18
17
  "type": "git",
19
18
  "url": "git+https://github.com/xiejay97/njs-modbus.git"
20
19
  },
21
- "license": "MIT",
22
- "author": "Xie Jay <xiejay97@gmail.com>",
20
+ "bugs": {
21
+ "url": "https://github.com/xiejay97/njs-modbus/issues"
22
+ },
23
23
  "sideEffects": false,
24
24
  "type": "module",
25
- "main": "dist/index.cjs",
26
- "module": "dist/index.mjs",
27
- "source": "src/index.ts",
28
- "types": "dist/index.d.ts",
25
+ "main": "./dist/index.cjs",
26
+ "module": "./dist/index.mjs",
27
+ "types": "./dist/index.d.cts",
29
28
  "exports": {
30
29
  ".": {
31
- "import": "./dist/index.mjs",
32
- "require": "./dist/index.cjs",
33
- "types": "./dist/index.d.ts"
30
+ "import": {
31
+ "types": "./dist/index.d.mts",
32
+ "default": "./dist/index.mjs"
33
+ },
34
+ "require": {
35
+ "types": "./dist/index.d.cts",
36
+ "default": "./dist/index.cjs"
37
+ }
34
38
  },
35
- "./utils": {
36
- "import": "./dist/utils.mjs",
37
- "require": "./dist/utils.cjs",
38
- "types": "./dist/utils.d.ts"
39
- }
39
+ "./package.json": "./package.json"
40
40
  },
41
41
  "files": [
42
- "dist",
43
- "*.d.ts"
42
+ "dist"
44
43
  ],
45
- "scripts": {
46
- "build": "node -e \"fs.rmSync('dist', {recursive: true, force: true})\" && rollup -c && node -e \"fs.rmSync('dist/src', {recursive: true, force: true})\"",
47
- "test": "tsx --test test/**/*.test.ts",
48
- "benchmark:report": "tsx benchmark/generate-report.ts",
49
- "benchmark:report:test": "tsx benchmark/test-report.ts",
50
- "benchmark:report:quick": "tsx benchmark/generate-report.ts -- --duration 10s --runs 2",
51
- "benchmark:report:full": "tsx benchmark/generate-report.ts -- --duration 120s --runs 5 --max-payload",
52
- "util:sort-package-json": "sort-package-json"
44
+ "publishConfig": {
45
+ "access": "public"
53
46
  },
54
47
  "devDependencies": {
55
- "@eslint/js": "^9.28.0",
56
- "@microsoft/api-extractor": "^7.52.8",
57
- "@nx/eslint-plugin": "21.1.3",
58
- "@rollup/plugin-commonjs": "^28.0.6",
59
- "@serialport/binding-mock": "^10.2.2",
60
- "@swc-node/register": "~1.10.10",
61
- "@swc/core": "~1.11.31",
62
- "@swc/helpers": "~0.5.17",
63
- "@types/node": "~24.0.0",
64
- "esbuild": "^0.25.5",
65
- "eslint": "^9.28.0",
66
- "eslint-config-prettier": "^10.1.5",
67
- "eslint-plugin-import": "2.31.0",
68
- "eslint-plugin-prettier": "^5.4.1",
69
- "jsmodbus": "^4.0.10",
70
- "microbundle": "^0.15.1",
71
- "modbus-serial": "^8.0.25",
72
- "nx": "21.1.3",
73
- "prettier": "^3.5.3",
74
- "rollup": "^4.43.0",
75
- "rollup-plugin-dts": "^6.2.1",
76
- "rollup-plugin-typescript2": "^0.36.0",
77
- "serialport": ">=12.0.0",
78
- "sort-package-json": "^3.2.1",
79
- "tslib": "^2.8.1",
80
- "tsx": "^4.21.0",
81
- "typescript": "~5.8.3",
82
- "typescript-eslint": "^8.34.0",
83
- "why-is-node-running": "^3.2.2"
48
+ "@eslint/js": "^9.39.4",
49
+ "@release-it/conventional-changelog": "^11.0.1",
50
+ "@types/node": "^18.19.130",
51
+ "@typescript/native-preview": "7.0.0-dev.20260509.2",
52
+ "@vitest/coverage-v8": "^4.1.8",
53
+ "eslint": "^9.39.4",
54
+ "eslint-config-flat-gitignore": "^2.3.0",
55
+ "eslint-config-prettier": "^10.1.8",
56
+ "eslint-plugin-import": "^2.32.0",
57
+ "eslint-plugin-prettier": "^5.5.6",
58
+ "prettier": "^3.8.4",
59
+ "release-it": "^20.2.0",
60
+ "tsdown": "^0.22.0",
61
+ "tsx": "^4.22.4",
62
+ "typedoc": "^0.28.19",
63
+ "typedoc-plugin-markdown": "^4.12.0",
64
+ "typescript": "^6.0.3",
65
+ "typescript-eslint": "^8.61.0",
66
+ "unplugin-unused": "^0.5.7",
67
+ "vitest": "^4.1.5"
84
68
  },
85
69
  "peerDependencies": {
86
70
  "serialport": ">=12.0.0"
87
71
  },
72
+ "peerDependenciesMeta": {
73
+ "serialport": {
74
+ "optional": true
75
+ }
76
+ },
88
77
  "engines": {
89
78
  "node": ">=18.19"
79
+ },
80
+ "scripts": {
81
+ "build": "tsdown",
82
+ "dev": "tsdown --watch",
83
+ "test": "vitest run",
84
+ "test:coverage": "vitest run --coverage",
85
+ "lint": "eslint .",
86
+ "typecheck": "tsc --noEmit",
87
+ "format": "prettier --write .",
88
+ "release": "release-it",
89
+ "docs:build": "typedoc",
90
+ "benchmark": "NODE_OPTIONS='--conditions=dev' tsx benchmark/bench-run.ts",
91
+ "benchmark:test": "NODE_OPTIONS='--conditions=dev' tsx benchmark/bench-test-report.ts",
92
+ "benchmark:fast": "NODE_OPTIONS='--conditions=dev' tsx benchmark/bench-run.ts --all --report --fast --max-payload",
93
+ "benchmark:full": "pnpm run build && NODE_OPTIONS='--conditions=dist' pnpm exec tsx benchmark/bench-run.ts --all --report --max-payload --runs 5 --duration 120 --chaos-requests 2000"
90
94
  }
91
- }
95
+ }