kafka-crab-js 1.4.0-beta → 1.4.0-beta.2

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.
Files changed (2) hide show
  1. package/js-binding.js +11 -9
  2. package/package.json +9 -10
package/js-binding.js CHANGED
@@ -3,8 +3,9 @@
3
3
  // @ts-nocheck
4
4
  /* auto-generated by NAPI-RS */
5
5
 
6
- const { createRequire } = require('node:module')
7
- require = createRequire(__filename)
6
+ import { createRequire } from 'node:module'
7
+ const require = createRequire(import.meta.url)
8
+ const __dirname = new URL('.', import.meta.url).pathname
8
9
 
9
10
  const { readFileSync } = require('node:fs')
10
11
  let nativeBinding = null
@@ -374,10 +375,11 @@ if (!nativeBinding) {
374
375
  throw new Error(`Failed to load native binding`)
375
376
  }
376
377
 
377
- module.exports.KafkaClientConfig = nativeBinding.KafkaClientConfig
378
- module.exports.KafkaConsumer = nativeBinding.KafkaConsumer
379
- module.exports.KafkaProducer = nativeBinding.KafkaProducer
380
- module.exports.CommitMode = nativeBinding.CommitMode
381
- module.exports.KafkaEventName = nativeBinding.KafkaEventName
382
- module.exports.PartitionPosition = nativeBinding.PartitionPosition
383
- module.exports.SecurityProtocol = nativeBinding.SecurityProtocol
378
+ const { KafkaClientConfig, KafkaConsumer, KafkaProducer, CommitMode, KafkaEventName, PartitionPosition, SecurityProtocol } = nativeBinding
379
+ export { KafkaClientConfig }
380
+ export { KafkaConsumer }
381
+ export { KafkaProducer }
382
+ export { CommitMode }
383
+ export { KafkaEventName }
384
+ export { PartitionPosition }
385
+ export { SecurityProtocol }
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "kafka-crab-js",
3
- "version": "1.4.0-beta",
3
+ "version": "1.4.0-beta.2",
4
4
  "main": "index.js",
5
5
  "types": "index.d.ts",
6
- "module": "commonjs",
6
+ "module": "module",
7
7
  "files": [
8
8
  "index.d.ts",
9
9
  "index.js",
@@ -52,24 +52,23 @@
52
52
  },
53
53
  "scripts": {
54
54
  "artifacts": "napi artifacts",
55
- "build": "napi build --js js-src/js-binding.js --dts js-src/js-binding.d.ts --no-const-enum --platform --release",
55
+ "build": "napi build --esm --js js-src/js-binding.js --dts js-src/js-binding.d.ts --no-const-enum --platform --release",
56
56
  "postbuild": "rimraf dist && tsc && copyfiles -f js-src/js-binding.d.ts js-src/js-binding.js ./dist/*.js ./dist/*.d.ts .",
57
57
  "build:debug": "napi build --platform",
58
58
  "prepublishOnly": "napi prepublish -t npm",
59
59
  "test": "node --test __test__/*.test.*",
60
60
  "test:integration": "node --test __test__/integration/*.test.*",
61
- "universal": "napi universal",
62
61
  "version": "napi version",
63
62
  "fmt": "dprint fmt",
64
63
  "lint": "true"
65
64
  },
66
65
  "packageManager": "pnpm@10.10.0",
67
66
  "optionalDependencies": {
68
- "kafka-crab-js-darwin-x64": "1.4.0-beta",
69
- "kafka-crab-js-darwin-arm64": "1.4.0-beta",
70
- "kafka-crab-js-linux-x64-gnu": "1.4.0-beta",
71
- "kafka-crab-js-linux-x64-musl": "1.4.0-beta",
72
- "kafka-crab-js-linux-arm64-gnu": "1.4.0-beta",
73
- "kafka-crab-js-linux-arm64-musl": "1.4.0-beta"
67
+ "kafka-crab-js-darwin-x64": "1.4.0-beta.2",
68
+ "kafka-crab-js-darwin-arm64": "1.4.0-beta.2",
69
+ "kafka-crab-js-linux-x64-gnu": "1.4.0-beta.2",
70
+ "kafka-crab-js-linux-x64-musl": "1.4.0-beta.2",
71
+ "kafka-crab-js-linux-arm64-gnu": "1.4.0-beta.2",
72
+ "kafka-crab-js-linux-arm64-musl": "1.4.0-beta.2"
74
73
  }
75
74
  }