'use strict' ; import * as path from 'path' ; import * as vscode from 'vscode' ; export class ModuleUtil { public static getModuleAsar ( moduleName ) { return require ( path . join ( vscode . env . appRoot , 'node_modules.asar' , moduleName ) ) ; } public static getModule ( moduleName ) { return require ( path . join ( vscode . env . appRoot , 'node_modules' , moduleName ) ) ; } public static getCoreNodeModule ( moduleName ) { try { return ModuleUtil . getModuleAsar ( moduleName ) ; } catch ( err ) { } try { return ModuleUtil . getModule ( moduleName ) ; } catch ( err ) { } return undefined ; } }