From cf8b6cdbdb0c8cd6f929b554f1b69d198d395459 Mon Sep 17 00:00:00 2001 From: Frazer Smith Date: Sun, 10 Sep 2023 10:24:13 +0100 Subject: [PATCH] perf: use `node:` prefix to bypass require.cache call for builtins (#228) See https://github.com/fastify/fastify-static/pull/407 --- index.js | 2 +- test/global.test.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index cd4f718..b9db876 100644 --- a/index.js +++ b/index.js @@ -1,6 +1,6 @@ 'use strict' -const { randomBytes } = require('crypto') +const { randomBytes } = require('node:crypto') const fp = require('fastify-plugin') const helmet = require('helmet') diff --git a/test/global.test.js b/test/global.test.js index 4a58ebf..901cd18 100644 --- a/test/global.test.js +++ b/test/global.test.js @@ -1,6 +1,6 @@ 'use strict' -const stream = require('stream') +const stream = require('node:stream') const { test } = require('tap') const fp = require('fastify-plugin') const Fastify = require('fastify')