This recipe transforms usage of the deprecatedDocumentation 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.
crypto.fips property to use the modern crypto.getFips() and crypto.setFips() methods.
What It Does
The codemod transforms:- Reading
crypto.fips→crypto.getFips() - Writing
crypto.fips = value→crypto.setFips(value) - Import statements to include
getFipsandsetFips
Usage
Examples
Reading FIPS Mode Status
Before
After
Enabling FIPS Mode
Before
After
Disabling FIPS Mode
Before
After
What is FIPS Mode?
FIPS (Federal Information Processing Standards) mode enables cryptographic operations that comply with FIPS 140-2 requirements. When enabled:- Only FIPS-approved cryptographic algorithms are available
- Node.js must be built with FIPS support
- Useful for applications requiring government-standard cryptography
Why Migrate?
Migrating to the getter/setter methods:- Provides explicit method calls for better code clarity
- Aligns with Node.js API conventions
- Enables better error handling
- Ensures compatibility with future Node.js versions
Common Usage Patterns
Check and Enable FIPS
Conditional FIPS Mode
Deprecation Reference
This migration addresses DEP0093.Related APIs
crypto.getFips()- Returns the current FIPS mode status (boolean)crypto.setFips(bool)- Enables or disables FIPS mode- Node.js must be compiled with
--openssl-fipsfor FIPS support