async function checkForUpdates() {
  console.log('Run plugins autoupdate')
  const plugins = await loadPlugins()

  const updatePromises = flow(
    filter(property('isUpdateAvailable')),
    map((plugin) => client.update(plugin.name))
  )(plugins)

  await Promise.all(updatePromises)

  console.log(updatePromises.length > 0
    ? `${updatePromises.length} plugins are updated`
    : 'All plugins are up to date')

  // Run autoupdate every 12 hours
  setTimeout(checkForUpdates, 12 * 60 * 60 * 1000)
}
Check plugins for updates and start plugins autoupdater