If you use camme / webdriverjs in node, you can use the following snippet:
client
.execute(function() {
return $('ul li').length;
}, [], function (err, result) {
console.log(result.value);
})
.call(done);
Here we get the number of list items using jquery. We process the result in a callback function, referring to result.value.
It is also available here: https://gist.github.com/ragulka/10458018