mirror of
https://github.com/amitwh/markdown-converter.git
synced 2026-08-03 02:11:07 +05:30
refactor(main): extract file ops to src/main/files/ (search, git, binary)
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
// src/main/files/binary.js
|
||||
// Binary file write handler (used by Word .docx export)
|
||||
const { ipcMain } = require('electron');
|
||||
const fs = require('fs').promises;
|
||||
|
||||
function register() {
|
||||
ipcMain.handle('write-buffer', async (_event, { path: filePath, buffer }) => {
|
||||
await fs.writeFile(filePath, Buffer.from(buffer));
|
||||
return { ok: true };
|
||||
});
|
||||
}
|
||||
|
||||
module.exports = { register };
|
||||
Reference in New Issue
Block a user