Skip to content

Commit

Permalink
Use node: to import built in modules
Browse files Browse the repository at this point in the history
  • Loading branch information
voxpelli committed May 15, 2022
1 parent ec7aa41 commit 4ebc956
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,8 @@ module.exports = function (session) {
const res = await this._asyncQuery('SELECT to_regclass($1::text)', [quotedTable], true);

if (res && res['to_regclass'] === null) {
const pathModule = require('path');
const fs = require('fs').promises;
const pathModule = require('node:path');
const fs = require('node:fs').promises;

// eslint-disable-next-line security/detect-non-literal-fs-filename
const tableDefString = await fs.readFile(pathModule.resolve(__dirname, './table.sql'), 'utf8');
Expand Down
4 changes: 2 additions & 2 deletions test/db-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

'use strict';

const fs = require('fs').promises;
const pathModule = require('path');
const fs = require('node:fs').promises;
const pathModule = require('node:path');

const pg = require('pg');

Expand Down

0 comments on commit 4ebc956

Please sign in to comment.