#28 export compare method for node.js

Fixes issues #28.