Skip to main content
This recipe transforms tmpDir function calls to tmpdir to handle Node.js DEP0022.

What It Does

This codemod updates:
  • Function calls from tmpDir() to tmpdir()
  • Import/require statements to use the correct function name

Before/After

Before:
import { tmpDir } from 'node:os';
const foo = tmpDir();
After:
import { tmpdir } from 'node:os';
const foo = tmpdir();

Usage

Run this codemod on your project:
npx codemod node/userland/tmpdir-to-tmpdir
This is a simple naming change where tmpDir() (with capital ‘D’) was deprecated in favor of the lowercase tmpdir() to maintain consistency with Node.js naming conventions.

Build docs developers (and LLMs) love