user29955: We are trying to make an app that generates an Arduino sketch (.ino) using Google's Blockly and node.js, and uploads it to Arduino.
Even after searching a lot, I am unable to find how to build and upload the generated code to the board. Is there any tool or API available for node.js to do the same?
Or could I call some binary for this function. Please help.

user4143: There are two things you need to do:

Compile the sketch into a .HEX file
Upload the sketch to the board

The first part can be done with arduino-builder which is part of the IDE since 1.6.6, or you can use one of various Makefile projects on a platform that supports make, or you can manually script it yourself calling the correct avr-gcc and avr-g++ commands. You can check the output of the IDE for what those are.
The second part is done, usually, using avrdude - again see the output of the IDE for the correct command format.

29955: <p>We are trying to make an app that generates an Arduino sketch (.ino) using Google's Blockly and node.js, and uploads it to Arduino.</p>

<p>Even after searching a lot, I am unable to find how to build and upload the generated code to the board. Is there any tool or API available for node.js to do the same?</p>

<p>Or could I call some binary for this function. Please help.</p>
 4143: <p>There are two things you need to do:</p>

<ol>
<li>Compile the sketch into a .HEX file</li>
<li>Upload the sketch to the board</li>
</ol>

<p>The first part can be done with <code>arduino-builder</code> which is part of the IDE since 1.6.6, or you can use one of various <code>Makefile</code> projects on a platform that supports <code>make</code>, or you can manually script it yourself calling the correct <code>avr-gcc</code> and <code>avr-g++</code> commands. You can check the output of the IDE for what those are.</p>

<p>The second part is done, usually, using <code>avrdude</code> - again see the output of the IDE for the correct command format.</p>
