Takes the contents of a directory and returns them as JSON in the parent directory.