Skip to content

Commit 0d3b346

Browse files
committed
style: use bare imports for Node.js built-ins
- Replace node: prefix with bare imports (e.g., 'node:fs' → 'fs') - Preserves node:sea and node:test if present (none found) - Aligns with project style guidelines
1 parent 70cbdfe commit 0d3b346

File tree

17 files changed

+28
-28
lines changed

17 files changed

+28
-28
lines changed

src/constants/platform.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* Platform detection and OS-specific constants.
33
*/
44

5-
import { platform } from 'node:os'
5+
import { platform } from 'os'
66

77
// Platform detection.
88
const _platform = platform()

src/cover/code.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* @fileoverview Code coverage utilities for parsing v8 coverage data.
33
*/
44

5-
import { promises as fs } from 'node:fs'
5+
import { promises as fs } from 'fs'
66

77
import { readJson } from '../fs'
88
import { isObjectObject } from '../objects'

src/dlx-binary.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
/** @fileoverview DLX binary execution utilities for Socket ecosystem. */
22

3-
import { createHash } from 'node:crypto'
3+
import { createHash } from 'crypto'
44

5-
import os from 'node:os'
5+
import os from 'os'
66

7-
import path from 'node:path'
7+
import path from 'path'
88

99
import { WIN32 } from '#constants/platform'
1010

src/dlx-package.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
* - dlxPackage() combines both for convenience
3131
*/
3232

33-
import path from 'node:path'
33+
import path from 'path'
3434

3535
import { WIN32 } from './constants/platform'
3636
import { getPacoteCachePath } from './constants/packages'

src/dlx.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/** @fileoverview DLX (execute package) utilities for Socket ecosystem shared installations. */
22

3-
import { createHash } from 'node:crypto'
3+
import { createHash } from 'crypto'
44

55
import { readDirNamesSync, safeDelete, safeMkdir, safeMkdirSync } from './fs'
66
import { normalizePath } from './path'

src/download-lock.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@
99
* `downloadWithLock()` from this module.
1010
*/
1111

12-
import { existsSync } from 'node:fs'
12+
import { existsSync } from 'fs'
1313

14-
import { mkdir, readFile, rm, stat, writeFile } from 'node:fs/promises'
14+
import { mkdir, readFile, rm, stat, writeFile } from 'fs/promises'
1515

16-
import { dirname, join } from 'node:path'
16+
import { dirname, join } from 'path'
1717
import type { HttpDownloadOptions, HttpDownloadResult } from './http-request'
1818
import { httpDownload } from './http-request'
1919

src/env/rewire.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
* - Thread-safe for concurrent test execution
1010
*/
1111

12-
import { AsyncLocalStorage } from 'node:async_hooks'
12+
import { AsyncLocalStorage } from 'async_hooks'
1313

1414
type EnvOverrides = Map<string, string | undefined>
1515

src/fs.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Provides enhanced fs operations, glob matching, and directory traversal functions.
44
*/
55

6-
import type { Abortable } from 'node:events'
6+
import type { Abortable } from 'events'
77

88
import type {
99
Dirent,
@@ -13,7 +13,7 @@ import type {
1313
PathLike,
1414
StatSyncOptions,
1515
WriteFileOptions,
16-
} from 'node:fs'
16+
} from 'fs'
1717

1818
import { getAbortSignal } from '#constants/process'
1919

src/git.ts

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

33
import { WIN32 } from '#constants/platform'
44
import { debugNs } from './debug'

src/http-request.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@
1414
* - Zero dependencies on external HTTP libraries.
1515
*/
1616

17-
import { createWriteStream } from 'node:fs'
17+
import { createWriteStream } from 'fs'
1818

19-
import type { IncomingMessage } from 'node:http'
19+
import type { IncomingMessage } from 'http'
2020

2121
let _http: typeof import('http') | undefined
2222
let _https: typeof import('https') | undefined

0 commit comments

Comments
 (0)