@nextcloud/paths
v2.2.1
Published
Helper functions for working with paths in Nextcloud apps
Downloads
22,395
Readme
@nextcloud/paths
Path helpers for Nextcloud apps.
Installation
npm i -S @nextcloud/paths
Usage
import { basename, dirname, encodePath, isSamePath, joinPaths } from '@nextcloud/paths'
basename('/my/file.txt')
// -> 'file.txt'
dirname('/my/file.txt')
// -> '/my'
encodePath('/my/other file.txt')
// -> '/my/other%20file'
isSamePath('/my/file.txt', 'my/file.txt')
// -> true
joinPaths('/my', 'folder', 'file.txt')
// -> '/my/folder/file.txt'