How in nodejs to implement a ban to re-run the script, if the script is running at the moment?
You can use the file mutex
https://www.npmjs.com/package/lockfile
var lockFile = require('lockfile') try{ lockFile.lockSync('some-file.lock'); }catch(er){ if(er!=undefined){ process.exit(); } } //single run code below But there is a problem, if the node process is closed through the task manager, then the lock file will not be deleted => the script will never be able to work again.
Are there any other options besides writing my own module?