Skip to content

getParentFilePath

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

지정된 경로보다 한 단계 위의 상위 경로를 반환합니다.

Parameters

  • filePath::string
  • isWindows::boolean
    Named
    : Whether the target operating system to be checked is Windows

Returns

string

Examples

javascript
getParentFilePath('C:\\Windows\\System32', true); // 'C:\Windows'
getParentFilePath('/home/user/text.txt'); // '/home/user'
dart
getParentFilePath('C:\\Windows\\System32', isWindows: true); // 'C:\Windows'
getParentFilePath('/home/user/text.txt'); // '/home/user'

Released under the MIT License