DenoDDeno
Powered by
abiA
Denoβ€’3y agoβ€’
2 replies
abi

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?
Deno banner
DenoJoin
Chat about Deno, a modern runtime for JavaScript and TypeScript.
20,934Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Simpler way to read a file relative to current module?
abiAabi / help
3y ago
How to get the path to the file from a deno_core op2?
AmyAAmy / help
9mo ago