feat: electron@28, supports "type": "module"

This commit is contained in:
草鞋没号
2023-12-30 14:14:46 +08:00
parent 7ec78d0366
commit 0d71c4bcd1
6 changed files with 23 additions and 22 deletions

5
src/demos/ipc.ts Normal file
View File

@@ -0,0 +1,5 @@
import { ipcRenderer } from 'electron'
ipcRenderer.on('main-process-message', (_event, ...args) => {
console.log('[Receive Main-process message]:', ...args)
})

8
src/demos/node.ts Normal file
View File

@@ -0,0 +1,8 @@
import { lstat } from 'node:fs/promises'
import { cwd } from 'node:process'
lstat(cwd()).then(stats => {
console.log('[fs.lstat]', stats)
}).catch(err => {
console.error(err)
})