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

ActiveComposer-plugin

oat-sa/composer-npm-bridge
==========================

NPM integration for Composer packages.

v0.4.6(1y ago)2165.6k↓15.6%3[1 PRs](https://github.com/oat-sa/composer-npm-bridge/pulls)3MITPHPPHP &gt;=5.6CI failing

Since May 20Pushed 1y ago23 watchersCompare

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

READMEChangelog (8)Dependencies (5)Versions (13)Used By (3)

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

[](#composer-npm-bridge)

*NPM integration for Composer packages.*

> This package is a fork from  (thanks to them!)

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

[](#installation)

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

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

[](#requirements)

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

Usage
-----

[](#usage)

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

```
composer require oat-sa/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 `oat-sa/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 run `npm install` for the NPM dependencies.

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.argumentsarray\[\]Add custom NPM arguments```
{
    // ...

    "extra": {
        "npm-bridge": {
            "timeout": 9000,
            "optional": true,
            "arguments": ["--prefix", "someDir"]
        },

        // ...
    }
}
```

*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

42

—

FairBetter than 90% of packages

Maintenance42

Moderate activity, may be stable

Popularity38

Limited adoption so far

Community31

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 50.4% 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 ~298 days

Recently: every ~385 days

Total

8

Last Release

465d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/98ddc6f1b615b1fac2d59f1e72d5dc6056cf6650414271da90cb3f0e203516fe?d=identicon)[bugalood](/maintainers/bugalood)

![](https://www.gravatar.com/avatar/c0ec704e0a8abaf0c27b227ad05d7aca23bc8f83d195229d94d4508cddc0fd24?d=identicon)[oat-lionel](/maintainers/oat-lionel)

![](https://www.gravatar.com/avatar/344a3314abc4364575e3ae1190a818e92411c2062f57ab77df9dabdd6572a7bc?d=identicon)[Wazelin](/maintainers/Wazelin)

---

Top Contributors

[![ezzatron](https://avatars.githubusercontent.com/u/100152?v=4)](https://github.com/ezzatron "ezzatron (64 commits)")[![krampstudio](https://avatars.githubusercontent.com/u/468620?v=4)](https://github.com/krampstudio "krampstudio (28 commits)")[![alroniks](https://avatars.githubusercontent.com/u/303498?v=4)](https://github.com/alroniks "alroniks (9 commits)")[![btamas](https://avatars.githubusercontent.com/u/537151?v=4)](https://github.com/btamas "btamas (8 commits)")[![wazelin](https://avatars.githubusercontent.com/u/2943256?v=4)](https://github.com/wazelin "wazelin (6 commits)")[![tikhanovichA](https://avatars.githubusercontent.com/u/1053022?v=4)](https://github.com/tikhanovichA "tikhanovichA (4 commits)")[![bartlomiejmarszal](https://avatars.githubusercontent.com/u/16231681?v=4)](https://github.com/bartlomiejmarszal "bartlomiejmarszal (2 commits)")[![BrianGilbert](https://avatars.githubusercontent.com/u/114017?v=4)](https://github.com/BrianGilbert "BrianGilbert (1 commits)")[![Magomogo](https://avatars.githubusercontent.com/u/728657?v=4)](https://github.com/Magomogo "Magomogo (1 commits)")[![damnedest](https://avatars.githubusercontent.com/u/246702?v=4)](https://github.com/damnedest "damnedest (1 commits)")[![SergiiTao](https://avatars.githubusercontent.com/u/36041347?v=4)](https://github.com/SergiiTao "SergiiTao (1 commits)")[![peetya](https://avatars.githubusercontent.com/u/18699247?v=4)](https://github.com/peetya "peetya (1 commits)")[![garex](https://avatars.githubusercontent.com/u/77981?v=4)](https://github.com/garex "garex (1 commits)")

---

Tags

plugincomposerpackageBridgeintegrationcomposer-pluginnpm

###  Code Quality

TestsPHPUnit

### Embed Badge

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

```
[![Health](https://phpackages.com/badges/oat-sa-composer-npm-bridge/health.svg)](https://phpackages.com/packages/oat-sa-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)
