Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/hjfitz/subpaths

List every possible subpath for a Unix path/URL Pathname
https://github.com/hjfitz/subpaths

path paths routing subpaths typescript

Last synced: 13 days ago
JSON representation

List every possible subpath for a Unix path/URL Pathname

Awesome Lists containing this project

README

        

# subpaths

Given any pathname, return every possible subpath!

## Usage

```js
import list from 'subpaths'

const paths = list(window.location.pathname) // ['/', '/hjfitz', '/hjfitz/subpaths']
```