fs.filename
fs.filename
Function
Returns the part of the last level name of the path minus the extension.
Syntax
fs(path).filename()
Parameters
No parameters.
Return value
| Type | Description |
|---|---|
| String | Returns the main name of the file. |
Example
file = fs('/var/log/app.log') result = file.filename() // Output: app print result
Notes
- Returns an empty string if the path has no primary name part.