abi
abi2y ago

How do you get the path to a file relative to the module which is referencing it?

const GET_PROGRAM_QUERY = Deno.readFileSync("./GetProgram.gql");
const GET_PROGRAM_QUERY = Deno.readFileSync("./GetProgram.gql");
GetProgram.gql is a file in the same directory as the calling module. The above doesn't work. Any ideas?
2 Replies
abi
abi2y ago
Ah, didn't get notified for some reason, but many thanks @iobdas 🙏