Skip to content

Latest commit

 

History

History
10 lines (7 loc) · 364 Bytes

20201201_require_main.md

File metadata and controls

10 lines (7 loc) · 364 Bytes

Use require.main to test if an adapter was started in compact mode

The module.parent is now deprecated in Node.js. As an alternative, require.main should be used. To update your code, just change the following line:

- if (module.parent) {
+ if (require.main !== module) {

If // @ts-ignore was used to suppress an error, you can delete it.