diff --git a/benchmark/create.js b/benchmark/create.js index b1aa6da..c2e6948 100644 --- a/benchmark/create.js +++ b/benchmark/create.js @@ -1,4 +1,3 @@ - /** * Module dependencies. */ diff --git a/benchmark/index.js b/benchmark/index.js index fb820ca..56c0fe3 100644 --- a/benchmark/index.js +++ b/benchmark/index.js @@ -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() diff --git a/benchmark/secret.js b/benchmark/secret.js index 7b33f74..37b2681 100644 --- a/benchmark/secret.js +++ b/benchmark/secret.js @@ -1,4 +1,3 @@ - /** * Module dependencies. */ diff --git a/benchmark/verify.js b/benchmark/verify.js index d5e1657..34ef99d 100644 --- a/benchmark/verify.js +++ b/benchmark/verify.js @@ -1,4 +1,3 @@ - /** * Module dependencies. */ diff --git a/index.js b/index.js index 40c45a3..9ca4edd 100644 --- a/index.js +++ b/index.js @@ -8,7 +8,7 @@ * MIT Licensed */ -const crypto = require('crypto') +const crypto = require('node:crypto') /** * Token generation/verification class. diff --git a/test/secret.test.js b/test/secret.test.js index ca50ddc..b402a55 100644 --- a/test/secret.test.js +++ b/test/secret.test.js @@ -76,11 +76,11 @@ test('Tokens.secret: should handle error, Promise', t => { t.plan(2) const Tokens = mock('..', { - crypto: { + 'node:crypto': { randomBytes: (_size, cb) => { cb(new Error('oh no')) }, - createHash: require('crypto').createHash + createHash: require('node:crypto').createHash } }) @@ -94,11 +94,11 @@ test('Tokens.secret: should handle error, callback', t => { t.plan(2) const Tokens = mock('..', { - crypto: { + 'node:crypto': { randomBytes: (size, cb) => { cb(new Error('oh no')) }, - createHash: require('crypto').createHash + createHash: require('node:crypto').createHash } })