PHPackages                             stevejoe/pathhelper - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. stevejoe/pathhelper

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

stevejoe/pathhelper
===================

Node.js path.join-style path helper for PHP. Join and normalize path segments with the correct directory separator.

v1.0.0(3mo ago)01MITPHPPHP &gt;=8.0

Since Mar 16Pushed 3mo agoCompare

[ Source](https://github.com/stevejoe2026/pathhelper)[ Packagist](https://packagist.org/packages/stevejoe/pathhelper)[ RSS](/packages/stevejoe-pathhelper/feed)WikiDiscussions master Synced 3w ago

READMEChangelogDependenciesVersions (2)Used By (0)

PathHelper
==========

[](#pathhelper)

Node.js `path.join`-style path helper for PHP. Join and normalize path segments using the platform directory separator.

Installation
------------

[](#installation)

```
composer require stevejoe/pathhelper
```

Usage
-----

[](#usage)

```
use Stevejoe\Pathhelper\PathHelper;

// Join segments (like Node's path.join)
PathHelper::join('foo', 'bar', 'baz');        // "foo/bar/baz" (or "foo\bar\baz" on Windows)
PathHelper::join('foo/', '/bar');             // "foo/bar"
PathHelper::join('/var', 'www', 'app');       // "/var/www/app" on Unix

// Normalize a path (resolve . and ..)
PathHelper::normalize('foo/bar/../baz');      // "foo/baz"
PathHelper::normalize('/foo/./bar/');         // "/foo/bar"

// Directory and base name
PathHelper::dirname('/foo/bar/baz.txt');      // "/foo/bar"
PathHelper::basename('/foo/bar/baz.txt');     // "baz.txt"
PathHelper::basename('/foo/bar/baz.txt', '.txt'); // "baz"
```

Requirements
------------

[](#requirements)

- PHP 8.0+

License
-------

[](#license)

MIT

###  Health Score

33

—

LowBetter than 72% of packages

Maintenance81

Actively maintained with recent releases

Popularity1

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity39

Early-stage or recently created project

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

99d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/d65bc1cff73cd6ebb830f22baddab3dfc213e4863f3d5f3feb59be68773227d4?d=identicon)[stevejoe2026](/maintainers/stevejoe2026)

---

Tags

normalizepathjoincross-platformdirnamebasename

### Embed Badge

![Health badge](/badges/stevejoe-pathhelper/health.svg)

```
[![Health](https://phpackages.com/badges/stevejoe-pathhelper/health.svg)](https://phpackages.com/packages/stevejoe-pathhelper)
```

###  Alternatives

[ergebnis/composer-normalize

Provides a composer plugin for normalizing composer.json.

1.1k40.0M2.6k](/packages/ergebnis-composer-normalize)[league/uri-components

URI components manipulation library

31937.4M88](/packages/league-uri-components)[matthiasmullie/path-converter

Relative path converter

10231.2M8](/packages/matthiasmullie-path-converter)[sebastianfeldmann/camino

Path management the OO way

177.0M1](/packages/sebastianfeldmann-camino)[wikimedia/relpath

Work with file paths to join or find the relative path

11919.6k3](/packages/wikimedia-relpath)[riimu/kit-pathjoin

Cross-platform library for normalizing and joining file system paths

12651.0k5](/packages/riimu-kit-pathjoin)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
