DEV Community 👩‍💻👨‍💻

DEV Community 👩‍💻👨‍💻 is a community of 963,503 amazing developers

We're a place where coders share, stay up-to-date and grow their careers.

Create account Log in

Discussion on: How to create a Task Scheduler in NodeJS

jay97 profile image
Jamal Al

Question: the script got be ruining all the time in order for this to work right? So if I turn off my PC, it's gone. Or is it written to the OS crontab?

entrptaher profile image
Md. Abu Taher 👨‍💻

You can use a package manager like pm2 to run it forever in background.

andre347 profile image
Andre de Vries Author

Good question! But yes if you turn your machine off the cron job will stop. I’ll have a look if I can find an npm package that actually writes to the crontab.