move to using require.main === module
This commit is contained in:
@@ -69,5 +69,5 @@ export async function fetchSuccessfullyOrThrowAsync(url: string): Promise<any> {
|
||||
* Tells if the code is being executed in the context of the command line (vs. a require for example)
|
||||
*/
|
||||
export function isCli(): boolean {
|
||||
return !module.parent;
|
||||
return require.main === module;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user