When working in a Ruby environment, you can access the defined constant RUBY_VERSION
.
Is there an equivalent to this in TypeScript that I can reference within a script without needing direct access to the system? I know that if I were running the code on my own computer, I could check the TypeScript compiler version by using the command tsc -V
for local scenarios or through a Node environment, but that's not ideal. Ideally, I would like something similar to the example below:
e.g. console.log(TS_VERSION)
// printVersion.ts
Unfortunately, the execution environment I'm currently using (leetcode) is detached and does not provide information about which version of TypeScript they are running. They do allow me to print to stdout though. The target environment is node 14.x.
I have already checked this page on LeetCode, but it only gives the version of Node, not the TypeScript compiler version.
UPDATE: After reaching out to LeetCode, they have updated their version page to include the TypeScript version as well.