nl_tokens: Try to load main app package
pl_tokens: function loadPackageName ( ) { var packageFile ; try { if ( require . main . filename ) { packageFile = find ( path . dirname ( require . main . filename ) ) ; } } catch ( e ) { packageFile = null ; } if ( ! packageFile && process . resourcesPath ) { packageFile = find ( path . <mask> ( process . resourcesPath , 'app.asar' ) ) ; var electronModule = path . join ( 'node_modules' , 'electron' , 'package.json' ) ; if ( packageFile && packageFile . indexOf ( electronModule ) !== - 1 ) { packageFile = null ; } } if ( ! packageFile ) { packageFile = find ( process . cwd ( ) ) ; } if ( ! packageFile ) { return null ; } var content = fs . readFileSync ( packageFile , 'utf-8' ) ; var packageData = JSON . parse ( content ) ; //noinspection JSUnresolvedVariable return packageData ? packageData . productName || packageData . name : false ; }