Problem:
- There is a bunch of badly named files
- We have a JSON array, with a title for each file, in order of the files in #1
- The title needs to be formatted as such to make it suitable for use over http
- The files need to be renamed, using the formatted title from #3
Takes a directory path and an array of new file names and renames those files to those specified in the array.
If number of files in directory do not match the length of array, an error is thrown.
Takes a string and converts it to lowercase, replaces any non-alphanumeric to a hyphen.
Example:
'The Declaration of Independence 1817–1819' becomes 'the-declaration-of-independence-1817-1819'.