voodootikigod/node-serialport — pull request #275 by programmarchy (2013-12-13 01:51:41+00:00)
Title: Add example to demonstrate drain()

The example here will send a bunch of echo requests, call drain to block until the requests have "left the pipe", wait for a duration, then repeat. Can be useful for dead-reckoning scenarios where you need to send some data, wait for it to leave the port's write queue, and wait a specific period of time before repeating another write.