fs模块
const files = fs.readdirSync(this.dir, { withFileTypes: true })
files = files
.map((file) => (file.isFile() ? file.name : null))
.filter((item) => item)
fs.readFileSync(codeFilePath, 'utf-8')
fs.mkdirSync(this.targetPath, { recursive: true })
child_process模块
const { execSync } = require('child_process')
const buffer = execSync(`python3 ${pythonShellPath} a b c`)
os模块
const homedir = os.homedir()
url
import { fileURLToPath } from 'node:url'
const __dirname = fileURLToPath(new URL('.', import.meta.url))