Node.js migration recipes help you automatically update deprecated APIs, migrate from external packages to built-in modules, and adopt modern Node.js best practices. Each recipe is a targeted codemod that can be run independently.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/nodejs/userland-migrations/llms.txt
Use this file to discover all available pages before exploring further.
Getting Started
All recipes are run using thecodemod CLI tool:
Recipe Categories
Buffer & Encoding
Migrations related to buffer operations and encoding/decoding.- buffer-atob-btoa - Migrate from legacy
buffer.atob()andbuffer.btoa()to modern Buffer APIs
Crypto & Security
Migrations for cryptographic APIs and security-related deprecations.- createCredentials-to-createSecureContext - Replace
crypto.createCredentialswithtls.createSecureContext(DEP0010) - crypto-fips-to-getFips - Replace
crypto.fipsproperty withcrypto.getFips()andcrypto.setFips()(DEP0093) - crypto-rsa-pss-update - Update RSA-PSS key generation options from
hash/mgf1HashtohashAlgorithm/mgf1HashAlgorithm(DEP0154)
File System
Migrations for file system API updates and deprecations.- dirent-path-to-parent-path - Replace
dirent.pathwithdirent.parentPath(DEP0178) - fs-access-mode-constants - Move access mode constants from
fs.*tofs.constants.*(DEP0176)
Module System
Migrations related to CommonJS and ES modules.- create-require-from-path - Replace
createRequireFromPathwithcreateRequire(DEP0130)
TypeScript
Migrations specific to TypeScript codebases.- correct-ts-specifiers - Fix TypeScript import specifiers to use correct file extensions for Node.js compatibility
External Dependencies
Migrations from third-party packages to Node.js built-in modules.- chalk-to-util-styletext - Replace the
chalkpackage with Node.js built-inutil.styleText()