Miss any of our Open RFC calls?Watch the recordings here! »

@m59/use-tmp-dir

0.1.3 • Public • Published

@m59/use-tmp-dir

Takes a function and calls it with a path to a temporary directory. The temporary directory is removed after the function completes.

const useTmpDir = require('@m59/use-tmp-dir')
 
(async () => {
    const result = await useTmpDir(async tmpDir => {
        await someFileSystemWritingThing({ outputDirectoryPath: tmpDir })
        return 123
    })
    result // => 123
})()

Install

npm i @m59/use-tmp-dir

DownloadsWeekly Downloads

0

Version

0.1.3

License

CC0-1.0

Unpacked Size

9.02 kB

Total Files

5

Last publish

Collaborators

  • avatar