add `samples/node-api.ts`
This commit is contained in:
		
							parent
							
								
									aa89677048
								
							
						
					
					
						commit
						c4304b61e6
					
				| 
						 | 
					@ -0,0 +1,13 @@
 | 
				
			||||||
 | 
					import { lstat } from 'fs/promises'
 | 
				
			||||||
 | 
					import { cwd } from 'process'
 | 
				
			||||||
 | 
					import { ipcRenderer } from 'electron'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					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)
 | 
				
			||||||
 | 
					})
 | 
				
			||||||
		Loading…
	
		Reference in New Issue