File: _temp.js

package info (click to toggle)
node-yarnpkg 1.13.0-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 92,980 kB
  • sloc: sh: 323; makefile: 19
file content (15 lines) | stat: -rw-r--r-- 297 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
/* @flow */

const temp = require('temp');

export default function(filename?: string): Promise<string> {
  return new Promise((resolve, reject) => {
    temp.mkdir(filename, function(err, path) {
      if (err) {
        reject(err);
      } else {
        resolve(path);
      }
    });
  });
}