1
3 Comments

Free option to execute a JavaScript function periodically

I have a JavaScript function that reads from a webpage and updates Firebase. Need to run this periodically (once a day, the execution time is less than a minute). What will be the best free option to host this script and run it periodically

on June 20, 2023
  1. 1

    Create a docker container and deploy it to fly.io free tier. You can then either configure the system cron in docker, or use an npm package like https://www.npmjs.com/package/cron and just keep the app running on Fly.

    Alternatively, get a NAS. I'd do this from my NAS :)

  2. 1

    Let's assume your function takes exactly 1 minute to run, not less. That means 1 min / day, which translates to 30 minutes per month. Which also translates to 30 * 60 = 1800 seconds.

    GoogleCloud (since you already you Firebase) offers way more than that for free, per month -- compute seconds I mean.

    Where I'm going with this is, you can create a Node runtime Function in Google Cloud with your code and execute that automatically, daily, with a watcher.

    1. 1

      Thanks. I am currently using the free Firebase Spark plan, looks like I need to upgrade to the Blaze plan to use Functions. I was trying to see if there are options without putting my credit card info