@robert.tools/fs
v1.3.0
Published
A package to provide tooling for interactions with the file system.
Maintainers
Readme
@robert.tools/fs
A package to provide tooling for interactions with the file system.
Installation
npm install @robert.tools/fsTroubleshooting
FS.readFile
This function returns string | object | undefined depending on the file content.
If you know the exact return type, you can type case it to avoid issues with TypeScript.
const json = FS.readFile('path/to/file.json') as object;
const str = FS.readFile('path/to/file.txt') as string;