2.1.0 • Published 3 years ago

@nextcloud/paths v2.1.0

Weekly downloads
2,024
License
GPL-3.0-or-later
Repository
github
Last release
3 years ago

@nextcloud/paths

Build Status npm Documentation

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

basename('/my/file.txt')
// -> 'file.txt'