PHPackages                             dyfeng/composer-asset-plugin - 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. dyfeng/composer-asset-plugin

ActiveComposer-plugin[Utility &amp; Helpers](/categories/utility)

dyfeng/composer-asset-plugin
============================

NPM/Bower Dependency Manager for Composer

v1.1.1(10y ago)05MITPHPPHP &gt;=5.3.3

Since Aug 4Pushed 10y ago1 watchersCompare

[ Source](https://github.com/DYFeng/composer-asset-plugin)[ Packagist](https://packagist.org/packages/dyfeng/composer-asset-plugin)[ Docs](https://github.com/francoispluchino/composer-asset-plugin)[ RSS](/packages/dyfeng-composer-asset-plugin/feed)WikiDiscussions master Synced 3w ago

READMEChangelogDependencies (2)Versions (11)Used By (0)

NPM/Bower Dependency Manager for Composer
=========================================

[](#npmbower-dependency-manager-for-composer)

[![Latest Version](https://camo.githubusercontent.com/c799afc9a43eee7bd2919eeb7057fb50095a3f0632352f4cdfa26608f081f832/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6678702f636f6d706f7365722d61737365742d706c7567696e2e737667)](https://packagist.org/packages/fxp/composer-asset-plugin)[![Build Status](https://camo.githubusercontent.com/17efe0669d999e0017307a304f292738772f19772998c61fec85b9f2d6613d9b/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f6672616e636f6973706c756368696e6f2f636f6d706f7365722d61737365742d706c7567696e2f6d61737465722e737667)](https://travis-ci.org/francoispluchino/composer-asset-plugin)[![Coverage Status](https://camo.githubusercontent.com/5eb54fe834b9f78c51015c668904375ce167a570cd7badd80b49f1d8e6df2908/68747470733a2f2f696d672e736869656c64732e696f2f636f766572616c6c732f6672616e636f6973706c756368696e6f2f636f6d706f7365722d61737365742d706c7567696e2f6d61737465722e737667)](https://coveralls.io/r/francoispluchino/composer-asset-plugin?branch=master)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/f6a022948fdfb2ec62f754ef11ba0f20513899f38194aa6e9c2aad124b93283d/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f6672616e636f6973706c756368696e6f2f636f6d706f7365722d61737365742d706c7567696e2e737667)](https://scrutinizer-ci.com/g/francoispluchino/composer-asset-plugin?branch=master)[![SensioLabsInsight](https://camo.githubusercontent.com/b7df2432df3e642db0acf4a729ac1da0d367ac609cafcf24ac46dbe62026c595/68747470733a2f2f696d672e736869656c64732e696f2f73656e73696f6c6162732f692f30643637636133332d356137322d343662382d623130392d6366626639353637336663652e737667)](https://insight.sensiolabs.com/projects/0d67ca33-5a72-46b8-b109-cfbf95673fce)

The Composer Asset Plugin allows you to manage project assets (css, js, etc.) in your `composer.json`without installing NPM or Bower.

This plugin works by transposing package information from NPM or Bower to a compatible version for Composer. This allows you to manage asset dependencies in a PHP based project very easily.

##### Features include:

[](#features-include)

- Works with native management system versions of VCS repository of composer
- Works with public and private VCS repositories
- Lazy loader of asset package definitions to improve performance
- Import filter with the dependencies of the root package and the installed packages, for increased dramatically the performance for the update
- Automatically get and create an Asset VCS repository defined in:
    - [NPM Registry](https://www.npmjs.org)
    - [Bower Registry](http://bower.io/search)
- Automatically get and create the Asset VCS repositories of dependencies defined in each asset package (dev dependencies included)
- Mapping conversion of asset package to composer package for:
    - [NPM Package](https://www.npmjs.org/doc/package.json.html) - [package.json](Resources/doc/schema.md#npm-mapping)
    - [Bower Package](http://bower.io/docs/creating-packages) - [bower.json](Resources/doc/schema.md#bower-mapping)
- Conversion of [Semver version](Resources/doc/schema.md#verison-conversion) to the composer version
- Conversion of [Semver range version](Resources/doc/schema.md#range-verison-conversion) to the composer range version
- Conversion of [dependencies with URL](Resources/doc/schema.md#url-range-verison-conversion) to the composer dependencies with the creation of VCS repositories
- Conversion of [multiple versions of the same dependency](Resources/doc/schema.md#multiple-version-of-depdendency-in-the-same-project) to different dependencies of composer
- Add manually the [multiple versions of a same dependency in the project](Resources/doc/index.md#usage-with-multiple-version-of-a-same-dependency)
- Add a [custom config of VCS Repository](Resources/doc/index.md#usage-with-vcs-repository)
- Override the [config of VCS Repository](Resources/doc/index.md#overriding-the-config-of-a-vcs-repository) defined by the asset registry directly in extra section of root composer
- VCS drivers for:
    - [Git](Resources/doc/index.md#usage-with-vcs-repository)
    - [GitHub](Resources/doc/index.md#usage-with-vcs-repository) (compatible with repository redirects)
    - [Git Bitbucket](Resources/doc/index.md#usage-with-vcs-repository)
    - [Mercurial](Resources/doc/index.md#usage-with-vcs-repository)
    - [Mercurial Bitbucket](Resources/doc/index.md#usage-with-vcs-repository)
    - [SVN](Resources/doc/index.md#usage-with-vcs-repository)
    - [Perforce](Resources/doc/index.md#usage-with-vcs-repository)
- Local cache system for:
    - package versions
    - package contents
    - repository redirects
- Custom asset installers configurable in the root file `composer.json`
- For Bower, all files defined in the section `ignore` will not be installed
- Disable or replace the deleting of the ignore files for Bower
- Enable manually the deleting of the ignore files for NPM
- Use the Ignore Files Manager in the Composer scripts
- Compatible with all commands, including:
    - `depends`
    - `diagnose`
    - `licenses`
    - `remove`
    - `require`
    - `search` (bower only)
    - `show`
    - `status`

##### Why this plugin?

[](#why-this-plugin)

There already are several possibilities for managing assets in a PHP project:

1. Install Node.js and use NPM or Bower command line in addition to Composer command line
2. Do #1, but add Composer scripts to automate the process
3. Include assets directly in the project (not recommended)
4. Create a repository with all assets and include the `composer.json` file (and use Packagist or an VCS Repository)
5. Add a package repository in `composer.json` with a direct download link
6. Create a Satis or Packagist server
7. Other?

It goes without saying that each javascript, CSS, etc. library should be developed with the usual tools for that language, which front-end developers know well. However, in the case of a complete project in PHP, it shouldn't be necessary to use several tools (PHP, Nodejs, Composer, NPM, Bower, Grunt, etc.) to simply install these assets in your project.

This plugin has been created to address these issues. Additionally, most developers will not add a `composer.json`file to their projects just to support php based projects, especially when npm and/or bower already exist and are widely used.

Documentation
-------------

[](#documentation)

The bulk of the documentation is located in `Resources/doc/index.md`:

[Read the Documentation](Resources/doc/index.md)

[Read the FAQs](Resources/doc/faqs.md)

[Read the Release Notes](https://github.com/francoispluchino/composer-asset-plugin/releases)

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

[](#installation)

All the installation instructions are located in [documentation](Resources/doc/index.md).

**The original `fxp/composer-asset-plugin` package will be replaced with `dyfeng/composer-asset-plugin` (version constraint should be set to latest, e.g. `dev-master`). You can still have `fxp/composer-asset-plugin` installed globally, but substitute it with this package in your project.**

See the [Release Notes](https://github.com/francoispluchino/composer-asset-plugin/releases)to know the Composer version required.

### Global scope (per user) installation

[](#global-scope-per-user-installation)

```
$ composer global require "dyfeng/composer-asset-plugin:dev-master"
```

### Project scope installation

[](#project-scope-installation)

```
$ composer require "dyfeng/composer-asset-plugin:dev-master"
```

Usage
-----

[](#usage)

Kill switch is triggered with `--ansi` or `--no-ansi` Composer options (add to taste), since there is no way for Composer plugins at present to add custom CLI options.

It is disabled automatically when `bower-asset` or `npm-asset` packages are submitted explicitly to command line.

License
-------

[](#license)

This composer plugin is under the MIT license. See the complete license in:

[Resources/meta/LICENSE](Resources/meta/LICENSE)

About
-----

[](#about)

Fxp Composer Asset Plugin is a [François Pluchino](https://github.com/francoispluchino) initiative. See also the list of [contributors](https://github.com/francoispluchino/composer-asset-plugin/contributors).

Reporting an issue or a feature request
---------------------------------------

[](#reporting-an-issue-or-a-feature-request)

Issues and feature requests are tracked in the [Github issue tracker](https://github.com/francoispluchino/composer-asset-plugin/issues).

###  Health Score

28

—

LowBetter than 52% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor1

Top contributor holds 91.7% 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 ~52 days

Total

10

Last Release

3874d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1531702?v=4)[Ngai-Fung Yip(叶毅锋)](/maintainers/DYFeng)[@DYFeng](https://github.com/DYFeng)

---

Top Contributors

[![francoispluchino](https://avatars.githubusercontent.com/u/567393?v=4)](https://github.com/francoispluchino "francoispluchino (429 commits)")[![gabor-udvari](https://avatars.githubusercontent.com/u/1449353?v=4)](https://github.com/gabor-udvari "gabor-udvari (10 commits)")[![huebs](https://avatars.githubusercontent.com/u/1166532?v=4)](https://github.com/huebs "huebs (8 commits)")[![alexandernst](https://avatars.githubusercontent.com/u/89727?v=4)](https://github.com/alexandernst "alexandernst (4 commits)")[![hason](https://avatars.githubusercontent.com/u/288535?v=4)](https://github.com/hason "hason (3 commits)")[![cebe](https://avatars.githubusercontent.com/u/189796?v=4)](https://github.com/cebe "cebe (2 commits)")[![steffendietz](https://avatars.githubusercontent.com/u/11530?v=4)](https://github.com/steffendietz "steffendietz (2 commits)")[![wangchj](https://avatars.githubusercontent.com/u/1118410?v=4)](https://github.com/wangchj "wangchj (2 commits)")[![ywarnier](https://avatars.githubusercontent.com/u/609839?v=4)](https://github.com/ywarnier "ywarnier (1 commits)")[![boekkooi](https://avatars.githubusercontent.com/u/399895?v=4)](https://github.com/boekkooi "boekkooi (1 commits)")[![jakoch](https://avatars.githubusercontent.com/u/85608?v=4)](https://github.com/jakoch "jakoch (1 commits)")[![JustDoItSascha](https://avatars.githubusercontent.com/u/8389022?v=4)](https://github.com/JustDoItSascha "JustDoItSascha (1 commits)")[![moufmouf](https://avatars.githubusercontent.com/u/1290952?v=4)](https://github.com/moufmouf "moufmouf (1 commits)")[![nadar](https://avatars.githubusercontent.com/u/3417221?v=4)](https://github.com/nadar "nadar (1 commits)")[![nsams](https://avatars.githubusercontent.com/u/50764?v=4)](https://github.com/nsams "nsams (1 commits)")[![Potherca](https://avatars.githubusercontent.com/u/195757?v=4)](https://github.com/Potherca "Potherca (1 commits)")

---

Tags

composerpackagenodejsassetbowernpmdependency manager

### Embed Badge

![Health badge](/badges/dyfeng-composer-asset-plugin/health.svg)

```
[![Health](https://phpackages.com/badges/dyfeng-composer-asset-plugin/health.svg)](https://phpackages.com/packages/dyfeng-composer-asset-plugin)
```

###  Alternatives

[fxp/composer-asset-plugin

NPM/Bower Dependency Manager for Composer

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

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

177289.8k26](/packages/foxy-foxy)[php-forge/foxy

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

45126.3k4](/packages/php-forge-foxy)[mouf/nodejs-installer

An installer package that let's you install NodeJS and NPM as a Composer dependency.

107705.0k15](/packages/mouf-nodejs-installer)[yohang/dependency-tools

A simple Composer script to install NPM and/or Bower dependencies

4214.9k2](/packages/yohang-dependency-tools)

PHPackages © 2026

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