w7a9q
w7a9q2mo ago

Getting version out of deno.json

How can I get data from deno.json on runtime without exposing it to client?
3 Replies
bbunks
bbunks2mo ago
What are you using for the build step?
w7a9q
w7a9qOP2mo ago
deno compile
bbunks
bbunks2mo ago
As far as I am aware, the compile step is just bundling the js into a single executable. I have not seen any way to make compiler flags or code replacement.
import packageInfo from "./deno.json" with { type: "json" };
import packageInfo from "./deno.json" with { type: "json" };
This is how i got the version out for the CLI i was working on, but it does import the entire json file.