-
-
Notifications
You must be signed in to change notification settings - Fork 31
Running on macOS
Jef LeCompte edited this page Jul 20, 2025
·
1 revision
Here’s a quick guide for installing Node.js on macOS and setting up a daily scheduled task to run your zap2xml script with the required arguments:
-
Installing Node.js
- Open Terminal.
- Install Homebrew if you don’t have it:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
- Install Node.js (LTS version) using Homebrew:
brew install node
- Verify installation:
node -v npm -v
-
Install zap2xml dependencies and build
In Terminal, run:
cd /path/to/zap2xml
npm install
npm run build
- Create a shell script to run zap2xml
Create a file named run-zap2xml.sh
in your zap2xml folder with the following content (edit the arguments as needed):
#!/bin/bash
cd /path/to/zap2xml
node dist/index.js --lineupId=YOUR_LINEUP_ID --timespan=15 --country=USA --postalCode=12345
Replace YOUR_LINEUP_ID
, 15
, USA
, and 12345
with your actual values.
Make the script executable:
chmod +x run-zap2xml.sh
- Schedule a daily task using launchd
- Create a property list file at
~/Library/LaunchAgents/com.zap2xml.daily.plist
with the following content (update the path as needed):<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>Label</key> <string>com.zap2xml.daily</string> <key>ProgramArguments</key> <array> <string>/path/to/zap2xml/run-zap2xml.sh</string> </array> <key>StartCalendarInterval</key> <dict> <key>Hour</key> <integer>2</integer> <key>Minute</key> <integer>0</integer> </dict> <key>StandardOutPath</key> <string>/tmp/zap2xml.log</string> <key>StandardErrorPath</key> <string>/tmp/zap2xml.err</string> </dict> </plist>
- Load the job:
launchctl load ~/Library/LaunchAgents/com.zap2xml.daily.plist
- The script will now run daily at 2:00 AM. Adjust the time in the plist as needed.
- Create a property list file at
This will run your zap2xml script once a day with your specified arguments on your macOS machine.