Path

Contains common operations for path manipulations.

Functions

All the current functions of the path module.

basename(path: string)

Returns the basename of the path string argument.


Path.basename("/user/bin"); //bin
                    

extension(path: string)

Returns the extension in the given path argument.


Path.extension("/user/bin/something.exe"); 
//exe
                    

dirname(path: string)

Returns the directory tree name of the given path.


Path.dirname("/user/bin/something/app.exe"); 
// /user/bin/something/
                    

isDir(path: string)

Returns true if the path leads to a directory, otherwise false.


Path.isDir("/user/fakeDirectory.txt"); 
//false
                    

listDir(path: string)

Returns a list containing the given directory's content.


Path.listDir(".") 
//["myFile1", "myDir2", "myFile2"]...
                    

isFile(path: string)

Returns true if the path leads to an actual file, otherwise false.


Path.isFile("/user/fakeDirectory.txt"); 
//true
                    

real(path: string)

Returns an absolute path for the given relative path.


Path.real("/user/bin/something/app.exe"); 
// C:\user\bin\something\app.exe
                    

Properties

All the current properties of the path module.

Separator

Represents the file and directory path seperator, changes depending on the platform.


Math.separator;
// '\' on windows
// '/' on others