update index.js

The things you learn. Figured out what this.directory does. Saves a lot
of work.