(prefix, options)
| 2038 | } |
| 2039 | |
| 2040 | async function mkdtempDisposable(prefix, options) { |
| 2041 | options = getOptions(options); |
| 2042 | |
| 2043 | prefix = getValidatedPath(prefix, 'prefix'); |
| 2044 | warnOnNonPortableTemplate(prefix); |
| 2045 | |
| 2046 | const cwd = process.cwd(); |
| 2047 | const path = await PromisePrototypeThen( |
| 2048 | binding.mkdtemp(prefix, options.encoding, kUsePromises), |
| 2049 | undefined, |
| 2050 | handleErrorFromBinding, |
| 2051 | ); |
| 2052 | // Stash the full path in case of process.chdir() |
| 2053 | const fullPath = pathModule.resolve(cwd, path); |
| 2054 | |
| 2055 | const remove = async () => { |
| 2056 | const rmrf = lazyRimRaf(); |
| 2057 | await rmrf(fullPath, { |
| 2058 | maxRetries: 0, |
| 2059 | recursive: true, |
| 2060 | retryDelay: 0, |
| 2061 | }); |
| 2062 | }; |
| 2063 | return { |
| 2064 | __proto__: null, |
| 2065 | path, |
| 2066 | remove, |
| 2067 | async [SymbolAsyncDispose]() { |
| 2068 | await remove(); |
| 2069 | }, |
| 2070 | }; |
| 2071 | } |
| 2072 | |
| 2073 | async function writeFile(path, data, options) { |
| 2074 | options = getOptions(options, { |
nothing calls this directly
no test coverage detected
searching dependent graphs…