Reputation: 83
I want to start my index.js file with node --max-old-space-size=1024 index.js
but I don't want to type the command manually everytime, any Idea how can I make a .js
file that executes the command for me? Like start.js
and when I launch it, it immediately runs node --max-old-space-size=1024 index.js
. This might be super straight forward but I'm still new to node.js 😅
Upvotes: 0
Views: 310
Reputation: 15225
You can modify your package.json
to create a command that execute node --max-old-space-size=1024 index.js
In your package.json
"scripts": {
"start": "node --max-old-space-size=1024 index.js"
}
And then run npm run start
.
Upvotes: 3