Files
hianime-api/src/utils/saveHtml.ts
2026-03-27 00:33:48 +06:00

20 lines
429 B
TypeScript

import * as path from 'path';
const saveHtml = async (html: string, fileName: string) => {
console.log(html);
try {
const fullPath = path.join(import.meta.dir + '../../../htmls/' + fileName);
console.log(fullPath);
await Bun.write(fullPath, html);
} catch (error: unknown) {
if (error instanceof Error) {
console.log('something went wrong' + error.message);
}
}
};
export default saveHtml;