refactor: use the node: protocol (#6710)

This commit is contained in:
Almeida
2021-10-02 12:40:02 +01:00
committed by GitHub
parent 466e796a1d
commit 531b46c60d
17 changed files with 28 additions and 28 deletions

View File

@@ -1,7 +1,7 @@
'use strict';
const EventEmitter = require('events');
const path = require('path');
const EventEmitter = require('node:events');
const path = require('node:path');
const { Error } = require('../errors');
const Util = require('../util/Util');
let childProcess = null;
@@ -21,8 +21,8 @@ class Shard extends EventEmitter {
constructor(manager, id) {
super();
if (manager.mode === 'process') childProcess = require('child_process');
else if (manager.mode === 'worker') Worker = require('worker_threads').Worker;
if (manager.mode === 'process') childProcess = require('node:child_process');
else if (manager.mode === 'worker') Worker = require('node:worker_threads').Worker;
/**
* Manager that created the shard