Merge dependabot/npm_and_yarn/examples/typescript/http-server-pool/fastify-cluster...
[poolifier.git] / benchmarks / versus-external-pools / functions / function-to-bench.js
index 5c63c794df69f26a61c12c8c04e8e3a18b0805ab..ff13bc9ecd2ad04fb034bab8a622198ad748e10a 100644 (file)
@@ -5,9 +5,9 @@
  * @param {*} data The worker data.
  * @returns {*} The result.
  */
-module.exports = function functionToBench (data) {
-  const crypto = require('crypto')
-  const fs = require('fs')
+const functionToBench = data => {
+  const crypto = require('node:crypto')
+  const fs = require('node:fs')
   const TaskTypes = {
     CPU_INTENSIVE: 'CPU_INTENSIVE',
     IO_INTENSIVE: 'IO_INTENSIVE'
@@ -48,3 +48,5 @@ module.exports = function functionToBench (data) {
       throw new Error(`Unknown task type: ${data.taskType}`)
   }
 }
+
+module.exports = functionToBench