To use the realpathsync
function from the fs-extra
library in Typescript, first you need to install the fs-extra
library:
index.ts21 chars2 lines
Then you can import the function and use it in your code:
index.ts215 chars9 lines
The realpathSync
function takes a path as a parameter and resolves any symbolic links in the path to their target location. If the target file doesn't exist or there was an error resolving the path, it will throw an error.
gistlibby LogSnag