Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nextcloud-libraries/nextcloud-paths
Path helpers for Nextcloud https://npmjs.org/@nextcloud/paths
https://github.com/nextcloud-libraries/nextcloud-paths
Last synced: 1 day ago
JSON representation
Path helpers for Nextcloud https://npmjs.org/@nextcloud/paths
- Host: GitHub
- URL: https://github.com/nextcloud-libraries/nextcloud-paths
- Owner: nextcloud-libraries
- License: gpl-3.0
- Created: 2019-06-18T07:07:59.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2024-04-22T12:22:46.000Z (5 months ago)
- Last Synced: 2024-04-22T13:10:19.489Z (5 months ago)
- Language: TypeScript
- Homepage: https://nextcloud-libraries.github.io/nextcloud-paths/
- Size: 2.67 MB
- Stars: 5
- Watchers: 3
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# @nextcloud/paths
[![REUSE status](https://api.reuse.software/badge/github.com/nextcloud-libraries/nextcloud-paths)](https://api.reuse.software/info/github.com/nextcloud-libraries/nextcloud-paths)
[![npm](https://img.shields.io/npm/v/@nextcloud/paths.svg)](https://www.npmjs.com/package/@nextcloud/paths)
[![Documentation](https://img.shields.io/badge/Documentation-online-brightgreen)](https://nextcloud-libraries.github.io/nextcloud-paths/)Path helpers for Nextcloud apps.
## Installation
```
npm i -S @nextcloud/paths
```## Usage
```js
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')
// -> truejoinPaths('/my', 'folder', 'file.txt')
// -> '/my/folder/file.txt'
```