mirror of
https://github.com/ryanwtf7/hianime-api.git
synced 2026-04-17 13:31:44 +00:00
20 lines
429 B
TypeScript
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;
|