converts js to coffeescript to match sync library's code