UNPKG

rajt

Version:

A serverless bundler layer, fully typed for AWS Lambda (Node.js and LLRT) and Cloudflare Workers.

8 lines (6 loc) 245 B
import { mkdirSync, existsSync } from 'node:fs' import { dirname } from 'node:path' export default function ensureDirectoryExists(filePath: string) { const dir = dirname(filePath) if (!existsSync(dir)) mkdirSync(dir, { recursive: true }) }