Skip to content

Commit

Permalink
feat: 增加解除内存溢出神器
Browse files Browse the repository at this point in the history
  • Loading branch information
pandaoh committed Sep 23, 2024
1 parent 18b8009 commit a589c6c
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
19 changes: 17 additions & 2 deletions bin/xcmd.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* @Author: HxB
* @Date: 2022-04-25 16:27:06
* @LastEditors: DoubleAm
* @LastEditTime: 2024-07-22 10:57:11
* @LastEditTime: 2024-09-23 18:08:19
* @Description: 命令处理文件
* @FilePath: \js-xcmd\bin\xcmd.js
*/
Expand Down Expand Up @@ -442,7 +442,7 @@ program
cmdStr = 'npm i nrm pnpm js-xcmd nodemon pm2 yarn rimraf turbo tsx taze knip yalc -g';
} else {
cmdStr =
'npm i nrm pnpm js-xcmd nodemon pm2 yarn rimraf turbo tsx taze knip yalc protobufjs protobufjs-cli @changesets/cli create-react-app @vue/cli @angular/cli cordova cnpm -g -force';
'npm i increase-memory-limit nrm pnpm js-xcmd nodemon pm2 yarn rimraf turbo tsx taze knip yalc protobufjs protobufjs-cli @changesets/cli create-react-app @vue/cli @angular/cli cordova cnpm -g -force';
}
console.log({ cmdStr });
nodeCmd.run(cmdStr, (err, data, stderr) => {
Expand Down Expand Up @@ -704,4 +704,19 @@ program
console.log(`JSON 文件合并完成,并保存为 【${mergedFilePath}】。`);
});

program
.option('increase-memory-limit', 'increase-memory-limit')
.command('increase-memory-limit')
.description('解决内存溢出神器')
.action(() => {
console.log('----------increase-memory-limit-Start----------');
const cmdStr = 'npm install -g increase-memory-limit && increase-memory-limit';
console.log({ cmdStr });
nodeCmd.run(cmdStr, (err, data, stderr) => {
if (err) return console.log(`%c出错啦!${data}`, 'color:red;');
console.log(data);
console.log('----------Npm-Install-IgnoreScripts-End----------');
});
});

program.parse(process.argv);
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "js-xcmd",
"version": "1.5.9",
"version": "1.5.10",
"description": "XCmd library for node.js.",
"main": "main.js",
"bin": {
Expand Down

0 comments on commit a589c6c

Please sign in to comment.