diff --git a/benchmarks/bare.cjs b/benchmarks/bare.cjs index 606c2c42..f50b0f52 100644 --- a/benchmarks/bare.cjs +++ b/benchmarks/bare.cjs @@ -1,6 +1,6 @@ 'use strict' -const server = require('http').createServer(function (req, res) { +const server = require('node:http').createServer(function (req, res) { res.setHeader('content-type', 'application/json; charset=utf-8') res.end(JSON.stringify({ hello: 'world' })) }) diff --git a/benchmarks/h3-router.cjs b/benchmarks/h3-router.cjs index 6447e8ea..7360a75b 100644 --- a/benchmarks/h3-router.cjs +++ b/benchmarks/h3-router.cjs @@ -1,6 +1,6 @@ 'use strict' -const { createServer } = require('http') +const { createServer } = require('node:http') const { createApp, toNodeListener, eventHandler, createRouter } = require('h3') const app = createApp() diff --git a/benchmarks/h3.cjs b/benchmarks/h3.cjs index 60c57ea8..242e6ee0 100644 --- a/benchmarks/h3.cjs +++ b/benchmarks/h3.cjs @@ -1,6 +1,6 @@ 'use strict' -const { createServer } = require('http') +const { createServer } = require('node:http') const { createApp, toNodeListener, eventHandler } = require('h3') const app = createApp() diff --git a/benchmarks/server-base-router.cjs b/benchmarks/server-base-router.cjs index 33c1ea3e..e992c011 100644 --- a/benchmarks/server-base-router.cjs +++ b/benchmarks/server-base-router.cjs @@ -1,4 +1,4 @@ -require('http') +require('node:http') .createServer( require('server-base-router')({ '@setup' (ctx) { diff --git a/benchmarks/spirit-router.cjs b/benchmarks/spirit-router.cjs index 4016bfda..e0b6816a 100644 --- a/benchmarks/spirit-router.cjs +++ b/benchmarks/spirit-router.cjs @@ -1,6 +1,6 @@ 'use strict' -const http = require('http') +const http = require('node:http') const { adapter } = require('spirit').node const route = require('spirit-router') diff --git a/benchmarks/spirit.cjs b/benchmarks/spirit.cjs index f9147424..8724f86f 100644 --- a/benchmarks/spirit.cjs +++ b/benchmarks/spirit.cjs @@ -1,6 +1,6 @@ 'use strict' -const http = require('http') +const http = require('node:http') const { adapter, response } = require('spirit').node diff --git a/benchmarks/vapr.cjs b/benchmarks/vapr.cjs index 50d3a5e0..c5ba0476 100644 --- a/benchmarks/vapr.cjs +++ b/benchmarks/vapr.cjs @@ -8,4 +8,4 @@ app.get('/', () => [ [JSON.stringify({ hello: 'world' })] ]) -require('http').createServer(app).listen(3000) +require('node:http').createServer(app).listen(3000) diff --git a/benchmarks/yeps-router.cjs b/benchmarks/yeps-router.cjs index 23186f38..fd43eb7d 100644 --- a/benchmarks/yeps-router.cjs +++ b/benchmarks/yeps-router.cjs @@ -1,4 +1,4 @@ -const http = require('http') +const http = require('node:http') const App = require('yeps') const Router = require('yeps-router') diff --git a/benchmarks/yeps.cjs b/benchmarks/yeps.cjs index 0a5c51e7..9d21e1c1 100644 --- a/benchmarks/yeps.cjs +++ b/benchmarks/yeps.cjs @@ -1,4 +1,4 @@ -const http = require('http') +const http = require('node:http') const App = require('yeps') const app = new App() diff --git a/metrics/process-results.cjs b/metrics/process-results.cjs index 92e2f8d2..427db7fd 100644 --- a/metrics/process-results.cjs +++ b/metrics/process-results.cjs @@ -1,6 +1,6 @@ -const fs = require('fs') -const path = require('path') -const os = require('os') +const fs = require('node:fs') +const path = require('node:path') +const os = require('node:os') function readableHRTimeMs (diff) { return (diff[0] * 1e9 + diff[1]) / 1000000 diff --git a/metrics/startup-listen.cjs b/metrics/startup-listen.cjs index 494e67ac..84dd885a 100644 --- a/metrics/startup-listen.cjs +++ b/metrics/startup-listen.cjs @@ -7,6 +7,6 @@ const loadingTime = process.hrtime(start) server.listen({ port: 3000 }, () => { const listenTime = process.hrtime(start) - require('fs').writeFileSync(`${__filename}.txt`, `${loadingTime} | ${listenTime}\n`, { encoding: 'utf-8', flag: 'a' }) + require('node:fs').writeFileSync(`${__filename}.txt`, `${loadingTime} | ${listenTime}\n`, { encoding: 'utf-8', flag: 'a' }) server.close() }) diff --git a/metrics/startup-routes-schema.cjs b/metrics/startup-routes-schema.cjs index 5e08e585..fb7a83cb 100644 --- a/metrics/startup-routes-schema.cjs +++ b/metrics/startup-routes-schema.cjs @@ -25,7 +25,7 @@ for (let i = 0; i < routes; ++i) { const loadingTime = process.hrtime(start) server.listen({ port: 0 }, () => { const listenTime = process.hrtime(start) - const path = require('path') - require('fs').writeFileSync(path.join(__dirname, `${routes}-${path.basename(__filename)}.txt`), `${loadingTime} | ${listenTime}\n`, { encoding: 'utf-8', flag: 'a' }) + const path = require('node:path') + require('node:fs').writeFileSync(path.join(__dirname, `${routes}-${path.basename(__filename)}.txt`), `${loadingTime} | ${listenTime}\n`, { encoding: 'utf-8', flag: 'a' }) server.close() }) diff --git a/metrics/startup-routes.cjs b/metrics/startup-routes.cjs index ddfa4a89..9b22aef4 100644 --- a/metrics/startup-routes.cjs +++ b/metrics/startup-routes.cjs @@ -17,7 +17,7 @@ const loadingTime = process.hrtime(start) server.listen({ port: 0 }, () => { const listenTime = process.hrtime(start) - const path = require('path') - require('fs').writeFileSync(path.join(__dirname, `${routes}-${path.basename(__filename)}.txt`), `${loadingTime} | ${listenTime}\n`, { encoding: 'utf-8', flag: 'a' }) + const path = require('node:path') + require('node:fs').writeFileSync(path.join(__dirname, `${routes}-${path.basename(__filename)}.txt`), `${loadingTime} | ${listenTime}\n`, { encoding: 'utf-8', flag: 'a' }) server.close() }) diff --git a/metrics/startup.cjs b/metrics/startup.cjs index 50e548e2..f352c478 100644 --- a/metrics/startup.cjs +++ b/metrics/startup.cjs @@ -1,7 +1,7 @@ 'use strict' -const { Worker } = require('worker_threads') -const path = require('path') +const { Worker } = require('node:worker_threads') +const path = require('node:path') const minSamples = 5