add execa, node-fetch as samples

This commit is contained in:
草鞋没号 2022-03-01 19:09:44 +08:00
parent 8e702586d5
commit cebd703848
3 changed files with 15 additions and 0 deletions

View File

@ -2,6 +2,8 @@ import { app, BrowserWindow, shell } from 'electron'
import { release } from 'os'
import { join } from 'path'
import './samples/electron-store'
import './samples/node-fetch'
import './samples/execa'
// Disable GPU Acceleration for Windows 7
if (release().startsWith('6.1')) app.disableHardwareAcceleration()

View File

@ -0,0 +1,6 @@
import { execa } from 'execa'
(async () => {
const { stdout } = await execa('echo', ['unicorns'])
// console.log(stdout)
})()

View File

@ -0,0 +1,7 @@
import fetch from 'node-fetch'
(async () => {
const body = await (await fetch('https://github.com/')).text()
// console.log(body)
})()