First of all, connect the usb cable on your Computer.
The, compile an example with NectarJS (example for Linux)
nectar arduino-led.js --target mega2560 --env arduino --flash /dev/ttyACM0
ttyACM0 represents the place where our IOT board is cabled.
NectarJS will understand that you are targetting an Arduino Mega 2560 with the Arduino env.*
Once compiled, you should see the led blinking.