-
张3
发布于 2025-05-22
-
收藏
??const?newConfig?=?config.replace(new?RegExp(`(?<=(${key}))\\d+`,?'g'),?port?||?'8080')??fs.writeFileSync(path,?newConfig)??exec(runFrp?+?path,?(error,?stdout,?stderr)?=>?{???console.log(stdout)??});??rl.close();}); 用正则替换端口,更好的方式是ini模块constini=...