electron/spec/fixtures/apps/libuv-hang/preload.js
Milan Burda d78f37ec8f
refactor: use node scheme imports in spec (#38487)
Co-authored-by: Milan Burda <miburda@microsoft.com>
2023-06-15 10:42:27 -04:00

16 lines
432 B
JavaScript

const { contextBridge, ipcRenderer } = require('electron');
contextBridge.exposeInMainWorld('api', {
ipcRenderer,
run: async () => {
const { promises: fs } = require('node:fs');
for (let i = 0; i < 10; i++) {
const list = await fs.readdir('.', { withFileTypes: true });
for (const file of list) {
if (file.isFile()) {
await fs.readFile(file.name, 'utf-8');
}
}
}
}
});