Add new method for index.js

Please review.