#!/usr/bin/env node

// src/common/atomic-write.ts
import { writeFileSync, renameSync, mkdirSync } from "fs";
import { dirname } from "path";
function atomicWriteFileSync(filePath, data, options = {}) {
  if (options.ensureDir) {
    mkdirSync(dirname(filePath), { recursive: true });
  }
  const tmpPath = `${filePath}.tmp`;
  writeFileSync(tmpPath, data, { mode: options.mode });
  renameSync(tmpPath, filePath);
}

export {
  atomicWriteFileSync
};
//# sourceMappingURL=chunk-NQDJ6QAM.js.map