DEP0081: fs.truncate() using a file descriptor
This recipe transforms the usage of fs.truncate() to fs.ftruncateSync() when a file descriptor is used.
See DEP0081.
Example
Before:
js
After:
js
Explore community-led codemods to migrate, optimize, and transform your codebase.
Build your own codemod and share it with the community.
Handle DEP0081 via transforming `truncate` to `ftruncateSync` when using a file descriptor.
The easiest way to run this codemod without installing anything globally:
This recipe transforms the usage of fs.truncate() to fs.ftruncateSync() when a file descriptor is used.
See DEP0081.
Before:
js
After:
js
Build your own codemod and share it with the community.