Skip to content

refactor: replace temp package with Node built-in fs.mkdtemp#584

Open
jb217 wants to merge 1 commit intoelectron:mainfrom
jb217:fix/replace-temp-with-node-builtins
Open

refactor: replace temp package with Node built-in fs.mkdtemp#584
jb217 wants to merge 1 commit intoelectron:mainfrom
jb217:fix/replace-temp-with-node-builtins

Conversation

@jb217
Copy link

@jb217 jb217 commented Mar 1, 2026

Summary

The temp package depends on rimraf@2.6.3 which depends on glob@7.2.3, both of which are deprecated and no longer maintained. The only usage of temp in this project is creating a single temporary directory via createTempDir, which maps directly to Node's built-in fs.mkdtemp combined with os.tmpdir.

This removes the temp and @types/temp dependencies entirely, eliminating the deprecated transitive dependency chain:

temp@0.9.4 -> rimraf@2.6.3 -> glob@7.2.3 -> inflight@1.0.6

All four packages in that chain are deprecated.

Changes

  • src/temp-utils.ts: Replace temp.mkdir with fs.mkdtemp + os.tmpdir + path.join
  • package.json: Remove temp from dependencies and @types/temp from devDependencies

Compatibility

fs.mkdtemp has been stable since Node 5.10.0 and util.promisify since Node 8.0.0, both within the existing engine requirement of >=8.0.0. The exported createTempDir function signature and return type are unchanged.

Verification

  • TypeScript compiles without errors
  • npm install produces no deprecation warnings from this dependency chain

The temp package depends on rimraf@2.6.3 which depends on glob@7.2.3,
both of which are deprecated and no longer maintained. The only usage
of temp in this project is creating a single temporary directory via
createTempDir, which maps directly to Node's built-in fs.mkdtemp
combined with os.tmpdir.

This removes the temp and @types/temp dependencies entirely,
eliminating the deprecated transitive dependency chain:
temp -> rimraf@2.6.3 -> glob@7.2.3 -> inflight@1.0.6

fs.mkdtemp has been stable since Node 5.10.0 and promisify since
Node 8.0.0, both within the existing engine requirement of >=8.0.0.
@jb217 jb217 requested a review from a team as a code owner March 1, 2026 01:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants