puppeteer/src/node/util.ts

14 lines
310 B
TypeScript
Raw Normal View History

2022-06-22 22:13:39 +00:00
import * as os from 'os';
/**
* Gets the temporary directory, either from the environmental variable
* `PUPPETEER_TMP_DIR` or the `os.tmpdir`.
*
* @returns The temporary directory path.
*
* @internal
*/
export const tmpdir = (): string => {
return process.env['PUPPETEER_TMP_DIR'] || os.tmpdir();
};