Skip to content

Commit 786fc05

Browse files
committed
chore: use the node: protocol
1 parent e810b27 commit 786fc05

File tree

11 files changed

+22
-22
lines changed

11 files changed

+22
-22
lines changed

__tests__/fdir.test.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
import { fdir } from "../src/index";
2-
import fs from "fs";
1+
import fs from "node:fs";
2+
import path, { sep } from "node:path";
33
import mock from "mock-fs";
4-
import { test, beforeEach, TestContext, vi } from "vitest";
5-
import path, { sep } from "path";
6-
import { convertSlashes } from "../src/utils";
74
import picomatch from "picomatch";
5+
import { test, beforeEach, TestContext, vi } from "vitest";
86
import { apiTypes, APITypes, cwd, restricted, root } from "./utils";
7+
import { fdir } from "../src/index";
8+
import { convertSlashes } from "../src/utils";
99

1010
beforeEach(() => {
1111
mock.restore();

__tests__/symlinks.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import { afterAll, beforeAll, beforeEach, describe, test } from "vitest";
2-
import { apiTypes, normalize, root } from "./utils";
1+
import path from "node:path";
32
import mock from "mock-fs";
4-
import { fdir, Options } from "../src";
5-
import path from "path";
3+
import { afterAll, beforeAll, describe, test } from "vitest";
4+
import { apiTypes, normalize, root } from "./utils";
5+
import { fdir } from "../src";
66

77
const fsWithRelativeSymlinks = {
88
"../../sym-relative/linked": {

__tests__/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import path from "path";
1+
import path from "node:path";
22

33
export type APITypes = (typeof apiTypes)[number];
44
export const apiTypes = ["withPromise", "sync"] as const;

benchmarks/benchmark.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ import recursiveFs from "recursive-fs";
1515
import b from "benny";
1616
import { getAllFilesSync, getAllFiles } from "get-all-files";
1717
import packageJson from "../package.json";
18-
import { readFileSync, readdirSync, writeFileSync } from "fs";
18+
import { readFileSync, readdirSync, writeFileSync } from "node:fs";
1919
import CSV2MD from "csv-to-markdown-table";
2020
import { getSystemInfo } from "./export";
21-
import { readdir } from "fs/promises";
21+
import { readdir } from "node:fs/promises";
2222

2323
async function benchmark() {
2424
const DIRECTORY = "node_modules";

benchmarks/fdir-benchmark.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import child_process from "child_process";
1+
import child_process from "node:child_process";
22
import { Fdir } from "../src/index";
33
import b from "benny";
44

src/api/functions/join-path.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { relative } from "path";
1+
import { relative } from "node:path";
22
import { Options, PathSeparator } from "../../types";
33
import { convertSlashes } from "../../utils";
44

src/api/functions/resolve-symlink.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import fs from "fs";
1+
import fs from "node:fs";
2+
import { dirname } from "node:path";
23
import { WalkerState, Options } from "../../types";
3-
import { dirname } from "path";
44

55
export type ResolveSymlinkFunction = (
66
path: string,

src/api/functions/walk-directory.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1+
import fs from "node:fs";
12
import { WalkerState } from "../../types";
2-
import fs from "fs";
33

44
export type WalkDirectoryFunction = (
55
state: WalkerState,

src/api/walker.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import { basename, dirname } from "path";
1+
import { Dirent } from "node:fs";
2+
import { basename, dirname } from "node:path";
23
import { isRootDirectory, normalizePath } from "../utils";
34
import { ResultCallback, WalkerState, Options } from "../types";
45
import * as joinPath from "./functions/join-path";
@@ -10,7 +11,6 @@ import * as resolveSymlink from "./functions/resolve-symlink";
1011
import * as invokeCallback from "./functions/invoke-callback";
1112
import * as walkDirectory from "./functions/walk-directory";
1213
import { Queue } from "./queue";
13-
import { Dirent } from "fs";
1414
import { Output } from "../types";
1515
import { Counter } from "./counter";
1616

src/builder/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { sep } from "path";
1+
import { sep } from "node:path";
22
import {
33
Output,
44
OnlyCountsOutput,
@@ -12,7 +12,7 @@ import {
1212
} from "../types";
1313
import { APIBuilder } from "./api-builder";
1414
import type picomatch from "picomatch";
15-
import type { Matcher, PicomatchOptions } from "picomatch";
15+
import type { Matcher } from "picomatch";
1616

1717
var pm: typeof picomatch | null = null;
1818
/* c8 ignore next 6 */

0 commit comments

Comments
 (0)