Skip to content
JS
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.

v3.0.2, 12 Nov 2015MITCommonJSTypes: NoneFiles and file systems
$ npm install relative

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
0200k400k600kSept 2025Mar 2026Sept 2026High 489.5k (3 Mar 2026)Low 246.9k (1 Sept 2026)
Weekly npm downloads, one point per week, weeks starting 23 Sept 2025 to 15 Sept 2026. The y axis starts at zero.

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

  1. v3 first release 3.0.0, 6 Apr 2015
  2. v2 first release 2.0.0, 21 Feb 2015
  3. v1 first release 1.0.0, 17 Nov 2014
  4. v0 first release 0.1.0, 2 Feb 2014

Recent releases

VersionPublished
3.0.212 Nov 2015
3.0.19 Jul 2015
3.0.06 Apr 2015
2.0.021 Feb 2015
1.2.025 Dec 2014
1.1.020 Dec 2014
1.0.117 Nov 2014
1.0.017 Nov 2014
0.1.66 Jul 2014
0.1.56 Jul 2014
0.1.420 Apr 2014
0.1.35 Apr 2014
0.1.28 Feb 2014
0.1.18 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
  • jsDelivrhttps://cdn.jsdelivr.net/npm/relative@3.0.2/
  • unpkghttps://unpkg.com/relative@3.0.2/
  • esm.shhttps://esm.sh/relative@3.0.2
Sources: npm registry, npm downloads API, GitHub API. Data fetched 25 Sept 2026.

Indexability: Indexed.