There are some templates here that might work for you.Intel(R) XDK IoT Edition node.js Templates | Intel® Developer Zone
Also, you could use the Sensor's tutorial to translate the Arduino code to your environment. Ultrasonic Range Finder EZ1 Retail - SparkFun Electronics . By using Aio functions and console.log instead of the analogRead and print.
I would recommend using either the analog voltage or serial output feature of the sensors to read the distance.
Analog voltage can be read using mraa (pre-installed on Edisons, or you can get the latest by including mraa in your package.json):
var mraa = require('mraa'); //require mraa
var analogPin0 = new mraa.Aio(0); //setup access analog input Analog pin #0 (A0)
var analogValue = analogPin0.read(); //read the value of the analog pin
console.log(analogValue); //write the value of the analog pin to the console
or you can use the serial interface using a combination of mraa (to enable serial interface) and node-serialport [voodootikigod/node-serialport · GitHub] (to read/write the port)
you can enable the serial port on edison by using the following mraa code (port is then accessable from /dev/ttyMFD1):
var m = require('mraa');
var uart = new m.Uart(0);