@user7886229 Node.js uses regular fetch() now, so you don't need additional packages. Should be an easy fix, just remove the import and make sure the functions are named "fetch".
@user7886229 See if this might help. It describes how to get a flat directory output from TS. It's more involved than just flipping a setting like outputFlatDirectoryStrructure. You apparently need to set two pieces of config for that instead.
@1.21gigawatts I don't think the first one would work. At best it describes an object which has one key called key with a value which is a string. But MyType should be a syntax error. Unless a newer version of TS made it the same as MyType: MyType, in which case the object also has a second key called MyType where the value is MyType (to follow short object properties in JS).
Doesn't seem like the first one is valid in TS 5.5: Playground Link
Using [] inside {} means it's an index signature. It defines the type of the key. Note that key is entirely superfluous - it can be any arbitrary string. It's only there to give a name for the key. It's the string of [key: string] that defines the type of the key. { [potato: string]: string } would work exactly the same if you change key
Yes, JSON.stringify() is a good way to do it. You can also override toString() and/or @@toPrimitive() but I find it's rarely needed. More precisely, I think I've never used it for any real code. Occasionally for some toy code.