Download ant-design/scripts/set-node-options.ts from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 396 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/f5071caa249115f3b590492f1c8eb471e02aae4b/ant-design/scripts/set-node-options.ts
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset@f5071caa249115f3b590492f1c8eb471e02aae4b/ant-design/scripts/set-node-options.ts
-
curl -L -o set-node-options.ts https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/f5071caa249115f3b590492f1c8eb471e02aae4b/ant-design/scripts/set-node-options.ts
396 Bytes
| import os from 'os'; | |
| const childProcess = require('child_process'); | |
| const totalMemory = Math.floor(os.totalmem() / (1024 * 1024)); | |
| if (totalMemory <= 8192) { | |
| // setting NODE_OPTIONS | |
| process.env.NODE_OPTIONS = '--max-old-space-size=4096'; | |
| } | |
| // Execute project startup command | |
| const args: string[] = process.argv.slice(2); | |
| childProcess.execSync(` ${args.join(' ')}`, { stdio: 'inherit' }); | |