We shouldn't be loading CATALOG.json files with require
require() looks for files relative to the js file it's being invoked from. Since I moved the js to ./lib, the tests now require weird stuff like this:
index_maker.init(
"../test_data/sample_CATALOG.json",
"./test/test_output/index.html",
true
);
The first filename needs to be relative to './lib', since it's being used in a require, but the second filename is just being written to, so it's relative to './'
This will just get worse when we're trying to call this code and it's in node_modules.
We should be using fs.readJSON and making it an async operation.
Also, require() calls are cached, which means that we'll get subtle bugs from this (see https://goenning.net/2016/04/14/stop-reading-json-files-with-require/)