https://github.com/s0/ts-util
Collection of small TypeScript npm utility packages, including get-relative-path
https://github.com/s0/ts-util
npm
Last synced: 28 days ago
JSON representation
Collection of small TypeScript npm utility packages, including get-relative-path
- Host: GitHub
- URL: https://github.com/s0/ts-util
- Owner: s0
- License: mit
- Created: 2019-06-21T22:19:52.000Z (almost 7 years ago)
- Default Branch: develop
- Last Pushed: 2022-12-03T14:42:44.000Z (over 3 years ago)
- Last Synced: 2026-01-15T12:42:17.766Z (5 months ago)
- Topics: npm
- Language: TypeScript
- Homepage:
- Size: 325 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Various utility methods for JavaScript / TypeScript
[](https://dev.azure.com/samlanning/general/_build/latest?definitionId=4&branchName=master) [](https://lgtm.com/projects/g/samlanning/ts-util/alerts/) [](https://lgtm.com/projects/g/samlanning/ts-util/context:javascript)
These packages are all implemented using pure TypeScript, and they can be easily included in frontend code using bundlers like webpack etc..
## [get-relative-path](get-relative-path)
[](https://www.npmjs.com/package/get-relative-path)
Similar to Node.js's [path.relative()](https://nodejs.org/api/path.html#path_path_relative_from_to)
but works outside the context of a filesystem, and assumes
all paths are POSIX-style.
So this also works for URL pathnames.
You can easily use this package by installing it in your Node.js project:
```
> npm install get-relative-path
```