How to use the dir function from tmp

Find comprehensive JavaScript tmp.dir code examples handpicked from public code repositorys.

670
671
672
673
674
675
676
677
678
679
680


function getTemporaryDirectory() {
  return new Promise((resolve, reject) => {
    // Unsafe cleanup lets us recursively delete the directory if it contains
    // contents; by default it only allows removal if it's empty
    tmp.dir({ unsafeCleanup: true }, (err, tmpdir, callback) => {
      if (err) {
        reject(err);
      } else {
        resolve({
fork icon0
star icon3
watch icon2