Nnodejs

nodejs/process-main-module

Handle DEP0138 via transforming `process.mainModule` to `require.main`.

transformationmigration
Public
21 executions
4 stars
How to Use
Run this codemod on your codebase using one of the following commands

The easiest way to run this codemod without installing anything globally:

Documentation

process.mainModule DEP0138

This recipe transforms the usage of process.mainModule to use require.main in CommonJS modules.

See DEP0138.

Example

diff

Ready to contribute?

Build your own codemod and share it with the community.