The requires syntax that was used in various modules is problematic because it stores the results of paths.get() at import time. This is probably best illustrated with an example:
const paths = require("./paths.js")
const paths2 = require("./paths.js").get();
paths.seed("/a/path/config", "/a/path/file")
console.log(paths.get().config); // <--- /a/path/config
console.log(paths2.config); // <--- !!! returns the default value: the results of resolve(os.homedir()), "/.droppy/config")
// because paths2 is set to the returned object of paths.get() at import time
Closes: #68
The requires syntax that was used in various modules is problematic because it stores the results of
paths.get()
at import time. This is probably best illustrated with an example: