Convert CommonJS require/module.exports snippets to ESM import/export and back (best-effort).
const fs = require("fs");
import fs from "fs";