i18next / i18next-http-backend

i18next-http-backend is a backend layer for i18next using in Node.js, in the browser and for Deno.
MIT License
443 stars 67 forks source link

Dereference timers in node.js so that the process may exit when finished #139

Closed danthegoodman closed 3 months ago

danthegoodman commented 3 months ago

Using the package in a node script is preventing the process from exiting because the reload interval timer has not been marked with unref. This PR resolves that issue.

For testing, I removed the --exit flag that had been previously been forcing mocha to exit immediately even if timers or servers were still open. This also required all servers and timers to in tests to be unrefed as well.

Checklist

danthegoodman commented 3 months ago

I didn't update the i18nextHttpBackend.js and ….min.js files because there were more changes in the files than just my targeted changes. I believe this is because the package-lock.json isn't in the repo, which means the babel/browserify packages have probably drifted slightly from the last run.

adrai commented 3 months ago

thank you, it's included in v2.5.2

danthegoodman commented 3 months ago

wow! So quick! Thank you 🎉