JSPM

  • Created
  • Published
  • Downloads 1188
  • Score
    100M100P100Q108662F
  • License MIT

Output a tree of files and directories by providing an object. Especially useful for testing.

Package Exports

  • with-local-tmp-dir

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (with-local-tmp-dir) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

with-local-tmp-dir

Coverage Status npm version dependency status devDependency status

Output a tree of files and directories by providing an object. Especially useful for testing.

Installation

npm install --save with-local-tmp-dir

Usage

const withLocalTmpDir = require('with-local-tmp-dir')

withLocalTmpDir(path => {
  console.log(path)
  //> /Users/max/project/tmp-18815DudQxmdn03Rz
})
// Now the folder does not exist anymore

// Also works with async functions =)
withLocalTmpDir(async path => await ...)

// The folder is removed even if an exception is thrown
withLocalTmpDir(async path => throw new Error('File could not be found'))

License

MIT © Sebastian Landwehr