UNPKG

lux-framework

Version:

Build scalable, Node.js-powered REST APIs with almost no code.

17 lines (14 loc) 316 B
// @flow import { readdir } from 'fs'; import { join } from 'path'; export default function getTmpFile(path: string) { return new Promise((resolve, reject) => { readdir(path, (err, files) => { if (err) { reject(err); return; } resolve(join(path, files[0])); }); }); }