Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 

README.md

process.assert to node:assert DEP0100

This recipe transforms the usage of process.assert to use node:assert module.

See DEP0100.

Example

+ import assert from "node:assert";
- process.assert(condition, "Assertion failed");
+ assert(condition, "Assertion failed");

Additional Notes

This codemod use fs capability to read the package.json file and determine if the project is using ES modules or CommonJS. Based on this information, it adds the appropriate import statement for the assert module.