Search code examples
node.jscron

how to pass variable to javascript from console


I can pass variable in console and set crontab like this in php how can I do in nodejs

*/5 * * * * php /var/www/html/acairpor/airpo.php BKKe


Solution

  • */5 * * * * node /path/to/script value1 value2 ...

    then value1 will be stored in process.argv[2] and value2 will be stored in process.argv[3]... etc