UNPKG

@walecloud/fastify-openapi-typescript-generator

Version:

Contains utilities to generate fastify types from openapi definition for the fastify framework.

10 lines (9 loc) 308 B
import fs from 'fs'; const { mkdir, stat } = fs.promises; export const isDirectory = (path) => stat(path) .then(stats => stats.isDirectory()) .catch(() => false); export const mkdirIfNotExists = async (path) => { if (!(await isDirectory(path))) await mkdir(path, { recursive: true }); };