UNPKG

@metacall/faas

Version:

Reimplementation of MetaCall FaaS platform written in TypeScript.

17 lines (16 loc) 529 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.ensureFolderExists = exports.exists = void 0; const fs_1 = require("fs"); const exists = async (path) => { try { await fs_1.promises.stat(path); return true; } catch (e) { return false; } }; exports.exists = exists; const ensureFolderExists = async (path) => ((await exports.exists(path)) || (await fs_1.promises.mkdir(path, { recursive: true })), path); exports.ensureFolderExists = ensureFolderExists;