PHPackages                             eloquent/composer-npm-bridge - 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. eloquent/composer-npm-bridge

AbandonedArchivedComposer-plugin

eloquent/composer-npm-bridge
============================

NPM integration for Composer packages.

5.0.1(3y ago)78857.0k↓17.3%18[2 issues](https://github.com/eloquent/composer-npm-bridge/issues)17MITPHPPHP &gt;=7.2

Since Oct 9Pushed 2y ago4 watchersCompare

[ Source](https://github.com/eloquent/composer-npm-bridge)[ Packagist](https://packagist.org/packages/eloquent/composer-npm-bridge)[ Docs](https://github.com/eloquent/composer-npm-bridge)[ RSS](/packages/eloquent-composer-npm-bridge/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (7)Versions (17)Used By (17)

> # No longer maintained
>
> [](#no-longer-maintained)
>
> This package is no longer maintained. See [this statement](https://gist.github.com/ezzatron/713a548735febe3d76f8ca831bc895c0) for more info.

Composer NPM bridge
===================

[](#composer-npm-bridge)

*NPM integration for Composer packages.*

[![Current version image](https://camo.githubusercontent.com/865e1bd65acf7ac9834356b18ff874c1bb6276cc42753293ef79b225dfd66de1/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f656c6f7175656e742f636f6d706f7365722d6e706d2d6272696467652e7376673f7374796c653d666c61742d737175617265 "This project uses semantic versioning")](https://packagist.org/packages/eloquent/composer-npm-bridge)[![Current build status image](https://camo.githubusercontent.com/0b0c87559ef221938fd3c7d01f852a6aa18f559a311cc1f4406f9b6d765f501c/687474703a2f2f696d672e736869656c64732e696f2f7472617669732f656c6f7175656e742f636f6d706f7365722d6e706d2d6272696467652f646576656c6f702e7376673f7374796c653d666c61742d737175617265 "Current build status for the develop branch")](https://travis-ci.org/eloquent/composer-npm-bridge)[![Current coverage status image](https://camo.githubusercontent.com/614df5773130f0c6881ef2b2279129949f59f714edba822674a94d0c5ef84899/68747470733a2f2f696d672e736869656c64732e696f2f636f6465636f762f632f6769746875622f656c6f7175656e742f636f6d706f7365722d6e706d2d6272696467652f646576656c6f702e7376673f7374796c653d666c61742d737175617265 "Current test coverage for the develop branch")](https://codecov.io/github/eloquent/composer-npm-bridge)

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

[](#installation)

- Available as [Composer](http://getcomposer.org/) package [eloquent/composer-npm-bridge](https://packagist.org/packages/eloquent/composer-npm-bridge).

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

[](#requirements)

- The `npm` executable must be available in PATH.

Usage
-----

[](#usage)

To utilize the *Composer NPM bridge*, simply add `eloquent/composer-npm-bridge`to the `require` section of the project's Composer configuration:

```
composer require eloquent/composer-npm-bridge

```

NPM dependencies are specified via a [package.json](https://npmjs.org/doc/json.html) configuration file in the root directory of the Composer package. Source control should be configured to ignore NPM's `node_modules` directory, similar to Composer's `vendor` directory.

How does it work?
-----------------

[](#how-does-it-work)

The *Composer NPM bridge* is a Composer plugin that automatically installs and updates [NPM](https://npmjs.org/) packages whenever the corresponding Composer command is executed. To detect compatible packages, the bridge inspects Composer package configuration information to find packages that directly require the `eloquent/composer-npm-bridge` Composer package itself.

In addition to normal operation, `composer install` will [install](https://npmjs.org/doc/install.html) NPM dependencies for all Composer packages using the bridge. This includes the root package, as well as Composer dependencies. Similarly, `composer update` will [install](https://npmjs.org/doc/install.html) NPM dependencies for all Composer dependencies using the bridge. It will also [update](https://npmjs.org/doc/update.html) the NPM dependencies for the root project.

NPM dependencies will be installed exactly as if `npm install` were run from the root directory of the package. This applies even if the package is installed as a dependency.

Configuration
-------------

[](#configuration)

The following configuration can be added to `composer.json` under the `extra.npm-bridge` section to customize the behavior on a per-package basis. Values in the root package will not currently impact any dependency packages that also use *Composer NPM bridge* - each package must define its own options.

KeyTypeDefaultDescriptiontimeoutint`300`Specify a custom timeout for the installation (in seconds).optionalbool`false`Skip instead of throwing an exception if `npm` is not found when processing the package.```
{
    // ...

    "extra": {
        "npm-bridge": {
            "timeout": 9000,
            "optional": true
        },

        // ...
    }
}
```

*Composer NPM bridge* can be completely disabled by setting the `COMPOSER_NPM_BRIDGE_DISABLE` environment variable to a non-empty value:

```
COMPOSER_NPM_BRIDGE_DISABLE=1 composer install
```

Caveats
-------

[](#caveats)

Because NPM dependencies are installed underneath the root directory of the Composer package, Composer may complain about working copy changes when the package is installed as a dependency. Source control should be configured to ignore the `node_modules` directory in order to avoid this.

###  Health Score

45

—

FairBetter than 93% of packages

Maintenance19

Infrequent updates — may be unmaintained

Popularity51

Moderate usage in the ecosystem

Community31

Small or concentrated contributor base

Maturity66

Established project with proven stability

 Bus Factor1

Top contributor holds 88.8% of commits — single point of failure

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

Every ~252 days

Recently: every ~449 days

Total

15

Last Release

1437d ago

Major Versions

0.3.0 → 1.0.02012-10-09

1.0.1 → 2.0.02014-01-29

2.1.1 → 3.0.02016-02-12

3.0.1 → 4.0.02017-07-12

4.1.0 → 5.0.02020-11-23

PHP version history (4 changes)0.1.0PHP &gt;=5.3.0

2.0.0PHP &gt;=5.3

4.0.0PHP &gt;=7

5.0.0PHP &gt;=7.2

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/100152?v=4)[Erin](/maintainers/ezzatron)[@ezzatron](https://github.com/ezzatron)

---

Top Contributors

[![ezzatron](https://avatars.githubusercontent.com/u/100152?v=4)](https://github.com/ezzatron "ezzatron (87 commits)")[![driskell](https://avatars.githubusercontent.com/u/939815?v=4)](https://github.com/driskell "driskell (5 commits)")[![damnedest](https://avatars.githubusercontent.com/u/246702?v=4)](https://github.com/damnedest "damnedest (1 commits)")[![garex](https://avatars.githubusercontent.com/u/77981?v=4)](https://github.com/garex "garex (1 commits)")[![Magomogo](https://avatars.githubusercontent.com/u/728657?v=4)](https://github.com/Magomogo "Magomogo (1 commits)")[![BrianGilbert](https://avatars.githubusercontent.com/u/114017?v=4)](https://github.com/BrianGilbert "BrianGilbert (1 commits)")[![NiklasBr](https://avatars.githubusercontent.com/u/279826?v=4)](https://github.com/NiklasBr "NiklasBr (1 commits)")[![bryonbean](https://avatars.githubusercontent.com/u/1581485?v=4)](https://github.com/bryonbean "bryonbean (1 commits)")

---

Tags

plugincomposerpackageBridgeintegrationcomposer-pluginnpm

###  Code Quality

TestsPHPUnit

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/eloquent-composer-npm-bridge/health.svg)

```
[![Health](https://phpackages.com/badges/eloquent-composer-npm-bridge/health.svg)](https://phpackages.com/packages/eloquent-composer-npm-bridge)
```

###  Alternatives

[fxp/composer-asset-plugin

NPM/Bower Dependency Manager for Composer

8894.8M41](/packages/fxp-composer-asset-plugin)[foxy/foxy

Fast, reliable, and secure NPM/Yarn/pnpm bridge for Composer

177287.5k25](/packages/foxy-foxy)[php-forge/foxy

Fast, reliable, and secure Bun/NPM/Yarn/pnpm bridge for Composer

45103.3k4](/packages/php-forge-foxy)

PHPackages © 2026

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