Adds index.js with length function exported
Checks for error if one is there
Adds check for filepath and add comments