believe there should be a way in accessing file system.
Include node.d.ts using npm i @types/node. And then create a new tsconfig.json file (npx tsc --init) and create a .ts file as followed:
import * as fs from 'fs';
fs.readFileSync('foo.txt','utf8');
You can use other functions in fs as well : https://nodejs.org/api/fs.html
More
Node quick start : https://basarat.gitbook.io/typescript/nodejs