Package
relative
Get the relative filepath from path A to path B. Calculates from file-to-directory, file-to-file, directory-to-file, and directory-to-directory.
Key numbers
As of 25 Sept 2026
- Weekly downloads
- 335.8k
- -22% over 12 months
- Gzip bundle size
- -
- No Bundlephobia data
- Dependencies
- 1
- Direct, from package.json
- Last release
- 10 years ago
- v3.0.2
- GitHub stars
- 33
- 8 forks
- Open issues / PRs
- 1 / 2
- Contributors
- -
- Commits, last 52 weeks
- 0
Downloads
Last week 2026-09-15 to 2026-09-21
335,754 downloads last week, 1,514,484 in the last month. The 12-month change of -22% compares the average of the last 4 weeks with the first 4 weeks of the series.
- Releases, last 12 months
- 015 in total
- Latest version
- 3.0.2, 12 Nov 201510 years ago
- First published
- 2 Feb 2014
- Last push to GitHub
- 14 Mar 20231,290 days before the snapshot
- Repository archived
- No
- Open issues
- 1
- Open pull requests
- 2
- Commits, last 52 weeks
- 0
- Dependents on npm
- 189
Major versions
- v3 first release 3.0.0, 6 Apr 2015
- v2 first release 2.0.0, 21 Feb 2015
- v1 first release 1.0.0, 17 Nov 2014
- v0 first release 0.1.0, 2 Feb 2014
Recent releases
| Version | Published |
|---|---|
| 3.0.2 | 12 Nov 2015 |
| 3.0.1 | 9 Jul 2015 |
| 3.0.0 | 6 Apr 2015 |
| 2.0.0 | 21 Feb 2015 |
| 1.2.0 | 25 Dec 2014 |
| 1.1.0 | 20 Dec 2014 |
| 1.0.1 | 17 Nov 2014 |
| 1.0.0 | 17 Nov 2014 |
| 0.1.6 | 6 Jul 2014 |
| 0.1.5 | 6 Jul 2014 |
| 0.1.4 | 20 Apr 2014 |
| 0.1.3 | 5 Apr 2014 |
| 0.1.2 | 8 Feb 2014 |
| 0.1.1 | 8 Feb 2014 |
- Module format
- CommonJSFrom package.json type, main and exports fields
- TypeScript types
- None
- Node.js engine range
- >= 0.8.0
- Runtimes
- -
- Unpacked size (npm)
- -
- Dependencies (1)
isobject
npm install relative- jsDelivr
https://cdn.jsdelivr.net/npm/relative@3.0.2/ - unpkg
https://unpkg.com/relative@3.0.2/ - esm.sh
https://esm.sh/relative@3.0.2
Indexability: Indexed.