Skip to content

getFileName

Node.js 런타임 필요 ('qsu/node')

경로 내의 파일 이름을 반환합니다.

Parameters

  • filePath::string: File or directory path
  • withExtension:boolean?|false
    Named
    : Returns the name with extension.

Returns

string

Examples

javascript
getFileName('/home/user/test.txt'); // 'test'
getFileName('/home/user/test.txt', true); // 'test.txt'
dart
getFileName('/home/user/test.txt'); // 'test'
getFileName('/home/user/test.txt', withExtension: true); // 'test.txt'

Released under the MIT License