Add list function to index.js

I need get cows' list from another script. Think these changes will be fine.