import * as os from 'os' ; import * as path from 'path' ; export function getTempFilePath ( baseFilename ? , extension ? ) { let randomName = '' ; extension = extension === undefined ? '.jsonc' : extension ; for ( let i = 0 ; i < 10 ; ++ i ) { randomName += String . fromCharCode ( 64 + Math . random ( ) * 26 ) ; } let tempName = `${ randomName }${ baseFilename ? `.${ baseFilename }` : '' }${ extension }` ; return path . join ( os . tmpdir ( ) , tempName ) ; }