diff --git a/src/sample/node-api.ts b/src/sample/node-api.ts new file mode 100644 index 0000000..8668059 --- /dev/null +++ b/src/sample/node-api.ts @@ -0,0 +1,14 @@ +import { lstat } from 'fs/promises' +import { cwd } from 'process' +import { ipcRenderer } from 'electron' + +// Usage of ipcRenderer.on +ipcRenderer.on('main-process-message', (_event, ...args) => { + console.log('[Receive Main-process message]:', ...args) +}) + +lstat(cwd()).then(stats => { + console.log('[fs.lstat]', stats) +}).catch(err => { + console.error(err) +})