@m59/use-tmp-dir

    1.0.2 • 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

    10

    Version

    1.0.2

    License

    CC0-1.0

    Unpacked Size

    10.5 kB

    Total Files

    5

    Last publish

    Collaborators

    • avatar