Skip to content

Commit bd37b0d

Browse files
committed
Convert to module
1 parent dfcb56c commit bd37b0d

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

build/setup-npm-registry.js

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,8 @@
33
* Licensed under the MIT License. See License.txt in the project root for license information.
44
*--------------------------------------------------------------------------------------------*/
55
// @ts-check
6-
'use strict';
7-
8-
const fs = require('fs').promises;
9-
const path = require('path');
6+
import { promises as fs } from 'fs';
7+
import { join, relative } from 'path';
108

119
/**
1210
* @param {string} dir
@@ -17,7 +15,7 @@ async function* getPackageLockFiles(dir) {
1715
const files = await fs.readdir(dir);
1816

1917
for (const file of files) {
20-
const fullPath = path.join(dir, file);
18+
const fullPath = join(dir, file);
2119
const stat = await fs.stat(fullPath);
2220

2321
if (stat.isDirectory()) {
@@ -46,7 +44,7 @@ async function main(url, dir) {
4644
const root = dir ?? process.cwd();
4745

4846
for await (const file of getPackageLockFiles(root)) {
49-
console.log(`Enabling custom NPM registry: ${path.relative(root, file)}`);
47+
console.log(`Enabling custom NPM registry: ${relative(root, file)}`);
5048
await setup(url, file);
5149
}
5250
}

0 commit comments

Comments
 (0)