Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

perf: use node: prefix to bypass require.cache call for builtins #241

Merged
merged 2 commits into from
Sep 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,7 @@ It allows the creation of an inheritance chain for the server instances.
The first parameter is the server instance and the second is the plugin function while the third is the options object that you give to use.

```js
const assert = require('assert')
const assert = require('node:assert')
const server = { count: 0 }
const app = require('avvio')(server)

Expand Down
4 changes: 2 additions & 2 deletions boot.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
'use strict'

const fastq = require('fastq')
const EE = require('events').EventEmitter
const inherits = require('util').inherits
const EE = require('node:events').EventEmitter
const inherits = require('node:util').inherits
const {
AVV_ERR_EXPOSE_ALREADY_DEFINED,
AVV_ERR_CALLBACK_NOT_FN,
Expand Down
2 changes: 1 addition & 1 deletion lib/debug.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict'

const { debuglog } = require('util')
const { debuglog } = require('node:util')

/**
* @callback DebugLogger
Expand Down
4 changes: 2 additions & 2 deletions lib/plugin.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict'

const { EventEmitter } = require('events')
const { inherits } = require('util')
const { EventEmitter } = require('node:events')
const { inherits } = require('node:util')
const { debug } = require('./debug')
const { createPromise } = require('./create-promise')
const { AVV_ERR_PLUGIN_EXEC_TIMEOUT } = require('./errors')
Expand Down
6 changes: 3 additions & 3 deletions test/await-after.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

const { test } = require('tap')
const boot = require('..')
const { promisify } = require('util')
const { promisify } = require('node:util')
const sleep = promisify(setTimeout)
const fs = require('fs').promises
const path = require('path')
const fs = require('node:fs').promises
const path = require('node:path')

test('await after - nested plugins with same tick callbacks', async (t) => {
const app = {}
Expand Down
2 changes: 1 addition & 1 deletion test/await-use.test.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict'

const { test } = require('tap')
const { promisify } = require('util')
const { promisify } = require('node:util')
const sleep = promisify(setTimeout)
const boot = require('..')

Expand Down
2 changes: 1 addition & 1 deletion test/express.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

const { test } = require('tap')
const express = require('express')
const http = require('http')
const http = require('node:http')
const boot = require('..')

test('express support', (t) => {
Expand Down
Loading