eslint_d.js
eslint_d.js copied to clipboard
Feature Request: Configurable max instances
I would like to be able to reduce the number of instances eslint_d keeps in memory. Currently eslint_d is using 1.3gb of memory with all 10 instances cached. Rather than eslint_d restarting regularly it'd be nice to be able to reduce this to 3-4 instances.
A way of configuring this could be via environment variables
export ESLINT_D_MAX_INSTANCES=5
eslint_d ./file.js
That makes sense. Would you care to send a PR to implement this?
Yep I can PR this, I'm noticing there's some references to CORE_D_TITLE
should I copy this in the env variable and call it CORE_D_MAX_INSTANCES
?
Are there any knock-on effects for testing?
Great! I think it should be called ESLINT_D_MAX_INSTANCES
because the cache is implemented here. You can see examples for testing in eslint-path-test
.
I've made the changes + added some error checking for invalid inputs but I'm having some trouble testing it. I've never developed a node CLI package before. What's the best way to run my branch of eslint_d on my machine. I've tried yarn global add "file:$PWD"
and npm link
.
npm link
worked fine for me when testing. But you can also simply invoke the bin/eslint_d.js
file from anywhere.