mirror of
https://github.com/ryanwtf7/hianime-api.git
synced 2026-04-17 21:41:44 +00:00
initial commit
This commit is contained in:
19
src/utils/saveHtml.ts
Normal file
19
src/utils/saveHtml.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
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;
|
||||
Reference in New Issue
Block a user