How should I read and write a text file from typescript in node.js? I am not sure would read/write a file be sandboxed in node.js, if not, i believe there should be a way i
import { readFileSync } from 'fs'; const file = readFileSync('./filename.txt', 'utf-8');
This worked for me. You may need to wrap the second command in any function or you may need to declare inside a class without keyword const.
const