Nnodejs

nodejs/create-require-from-path

Handle DEP0130 via transforming `createRequireFromPath` to `createRequire`.

transformationmigration
Public
41 executions
Run locally
npx codemod @nodejs/create-require-from-path
Documentation

createRequireFromPath DEP0130

This recipe transforms the usage of createRequireFromPath to use the createRequire function from the node:module module.

See DEP0130.

Example

diff

Ready to contribute?

Build your own codemod and share it with the community.