diff --git a/README.md b/README.md index 4614145..7d56fa9 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ npm i @fastify/kafka ### Usage ```js -const crypto = require('crypto') +const crypto = require('node:crypto') const fastify = require('fastify')() const group = crypto.randomBytes(20).toString('hex') diff --git a/examples/basic.js b/examples/basic.js index 6f383a5..8896243 100644 --- a/examples/basic.js +++ b/examples/basic.js @@ -1,6 +1,6 @@ 'use strict' -const crypto = require('crypto') +const crypto = require('node:crypto') const fastify = require('fastify')({ logger: { level: 'debug' diff --git a/examples/multiple-consumers.js b/examples/multiple-consumers.js index 8a4463c..63634f5 100644 --- a/examples/multiple-consumers.js +++ b/examples/multiple-consumers.js @@ -1,6 +1,6 @@ 'use strict' -const crypto = require('crypto') +const crypto = require('node:crypto') const fastifyKafka = require('..') const fastify = require('fastify') diff --git a/lib/consumer.js b/lib/consumer.js index 98352f0..6ffb0fd 100644 --- a/lib/consumer.js +++ b/lib/consumer.js @@ -1,7 +1,7 @@ 'use strict' -const EE = require('events').EventEmitter -const inherits = require('util').inherits +const EE = require('node:events').EventEmitter +const inherits = require('node:util').inherits const Kafka = require('node-rdkafka') function Consumer (opts, log, next, topicConf, metadataOptions) { diff --git a/lib/producer.js b/lib/producer.js index 3c87893..d508802 100644 --- a/lib/producer.js +++ b/lib/producer.js @@ -1,7 +1,7 @@ 'use strict' -const EE = require('events').EventEmitter -const inherits = require('util').inherits +const EE = require('node:events').EventEmitter +const inherits = require('node:util').inherits const Kafka = require('node-rdkafka') function Producer (opts, log, next, topicConf, metadataOptions) { diff --git a/test/utils.js b/test/utils.js index 8e80e3a..1f2891d 100644 --- a/test/utils.js +++ b/test/utils.js @@ -1,6 +1,6 @@ 'use strict' -const crypto = require('crypto') +const crypto = require('node:crypto') module.exports.getDefaultOptions = function getDefaultOptions () { return {