a method for finding all common strings for node.js