2017 © Pedro Peláez
 

library npm-handler

Run npm install through composer

image

benjaminlazarecki/npm-handler

Run npm install through composer

  • Thursday, July 30, 2015
  • by blazarecki
  • Repository
  • 0 Watchers
  • 3 Stars
  • 307 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 4 Versions
  • 0 % Grown

The README.md

NpmHandler

The project allow you to automatically install NPM dependencies during composer install or/and update., (*1)

Installation

Require the npm handler in your composer.json file:, (*2)

{
    "require": {
        "blazarecki/npm-handler": "0.1.*",
    }
}

And update the scripts part to run npm handler automatically on install or/and update., (*3)

{
    "scripts": {
        "post-install-cmd": [
            "Scar\\NpmHandler\\Composer\\NpmHandler::install"
        ],
        "post-update-cmd": [
            "Scar\\NpmHandler\\Composer\\NpmHandler::install"
        ]
    }
}

Usage

Add a package.json somewhere in your project., (*4)

For example:, (*5)

{
    "name": "my-app",
    "description": "description of my-app",
    "repository": {},
    "dependencies" : {
        "bower"    :  "1.2.x",
        "less"     :  "1.4.x"
    },
    "devDependencies": {
        "phantomjs":  "1.9.x"
    }
}

See this for more details about package.json file, (*6)

Now each time you'll run composer install or composer update the command npm install will be call in the package.json dir., (*7)

You can create multiple package.json files anywhere in your project., (*8)

Configuration

In your composer.json file you can specified some packages to exclude in the extra block., (*9)

{
   "extra": {
        "npm-handler": {
            "exclude-packages": {
                "somedir",
                "otherdir/package.json"
            }
        }
    }
}

You can also specified the absolute or relative path to npm executable (useful when using multiple versions), (*10)

{
   "extra": {
        "npm-handler": {
            "npm-path": "/path/to/npm"
        }
    }
}

If you want to install devDependencies you must run composer in dev mode. composer install --dev, (*11)

Enjoy and feel free to contribute !, (*12)

The Versions

30/07 2015

dev-master

9999999-dev

Run npm install through composer

  Sources   Download

MIT

The Requires

 

The Development Requires

composer npm package.json

31/10 2013

0.1.2

0.1.2.0

Run npm install through composer

  Sources   Download

MIT

The Requires

 

The Development Requires

composer npm package.json

22/10 2013

0.1.1

0.1.1.0

Run npm install through composer

  Sources   Download

MIT

The Requires

 

The Development Requires

composer npm package.json

10/10 2013

0.1.0

0.1.0.0

Run npm install through composer

  Sources   Download

MIT

The Requires

 

The Development Requires

composer npm package.json