Skip to content

Commit

Permalink
perf: use node: prefix to bypass require.cache call for builtins
Browse files Browse the repository at this point in the history
  • Loading branch information
Fdawgs committed Sep 10, 2023
1 parent 90ccc1f commit d9574cc
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions benchmark/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const fs = require('fs')
const path = require('path')
const spawn = require('child_process').spawn
const fs = require('node:fs')
const path = require('node:path')
const spawn = require('node:child_process').spawn

const exe = process.argv[0]
const cwd = process.cwd()
Expand Down
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* MIT Licensed
*/

const crypto = require('crypto')
const crypto = require('node:crypto')

/**
* Token generation/verification class.
Expand Down
4 changes: 2 additions & 2 deletions test/secret.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ test('Tokens.secret: should handle error, Promise', t => {
randomBytes: (_size, cb) => {
cb(new Error('oh no'))
},
createHash: require('crypto').createHash
createHash: require('node:crypto').createHash
}
})

Expand All @@ -98,7 +98,7 @@ test('Tokens.secret: should handle error, callback', t => {
randomBytes: (size, cb) => {
cb(new Error('oh no'))
},
createHash: require('crypto').createHash
createHash: require('node:crypto').createHash
}
})

Expand Down

0 comments on commit d9574cc

Please sign in to comment.