-'use strict';
-
-const { access, cp, mkdir, readdir, readFile, rm, writeFile } = require('fs/promises');
-const { exec } = require('child_process');
-const { basename, resolve, join } = require('path');
-const ParseGemini = require('gemini-to-html/parse');
-const RenderGemini = require('gemini-to-html/render');
-const { debuglog, promisify } = require('util');
+import { access, cp, readdir, readFile, writeFile } from 'fs/promises';
+import { exec } from 'child_process';
+import { basename, join } from 'path';
+import ParseGemini from 'gemini-to-html/parse.js';
+import RenderGemini from 'gemini-to-html/render.js';
+import { debuglog, promisify } from 'util';
+import { ensureDirectoryExists, rmIfExists } from './utils.js';
+import { kFileNotFoundError } from './constants.js';