Update index.js

Fix bug when there are spaces in file paths.