2017 © Pedro PelĂĄez
 

composer-plugin nodejs-installer

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

image

mouf/nodejs-installer

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

  • Monday, April 16, 2018
  • by mouf
  • Repository
  • 14 Watchers
  • 92 Stars
  • 173,882 Installations
  • PHP
  • 12 Dependents
  • 0 Suggesters
  • 18 Forks
  • 5 Open issues
  • 16 Versions
  • 9 % Grown

The README.md

Latest Stable Version Latest Unstable Version License Scrutinizer Code Quality, (*1)

NodeJS installer for Composer

This is an installer that will download NodeJS and NPM and install them in your Composer dependencies. Installation is skipped if NodeJS is already available on your machine., (*2)

Why?

NodeJS is increasingly becoming a part of the tool-chain of modern web developers. Tools like Bower, Grunt, Gulp... are used everyday to build applications. For the PHP developer, this means PHP projects have build dependencies on NodeJS or Bower / NPM packages. The NodeJS-installer attempts to bridge the gap between NodeJS and PHP by making NodeJS easily installable as a Composer dependency., (*3)

Building on this package, other packages like koala-framework/composer-extra-assets can be used to automatically fetch Bower / NPM packages, run Gulp / Grunt tasks, etc..., (*4)

How does it work?

Simply include this package in your composer.json requirements:, (*5)

{
    "require": {
        "mouf/nodejs-installer": "~1.0"
    }
}

By default, if NodeJS is not available on your computer, it will be downloaded and installed in vendor/nodejs/nodejs., (*6)

You should access NodeJS and NPM using the scripts created into the vendor/bin directory:, (*7)

  • vendor/bin/node (vendor/bin/node.bat on Windows)
  • vendor/bin/npm (vendor/bin/npm.bat on Windows)

Options

A number of options are available to customize NodeJS installation:, (*8)

{
    "require": {
        "mouf/nodejs-installer": "~1.0"
    },
    "extra": {
        "mouf": {
            "nodejs": {
                "version": "~0.12",
                "targetDir": "vendor/nodejs/nodejs",
                "forceLocal": false
            }
        }
    }
}

Available options:, (*9)

  • version: This is the version number of NodeJS that will be downloaded and installed. You can specify version constraints in the usual Composer format (for instance "~0.12" or ">0.11").
    Default value: * The latest stable version of NodeJS is installed by default.
  • targetDir: The target directory NodeJS will be installed in. Relative to project root.
    This option is only available in the root package.
    Default value: vendor/nodejs/nodejs
  • forceLocal (boolean): If set to true, NodeJS will always be downloaded and installed locally, even if NodeJS is already available on your computer.
    This option is only available in the root package.
    Default value: false
  • includeBinInPath (boolean): After the plugin is run in Composer, the vendor/bin directory can optionally be added to the PATH. This is useful if other plugins rely on "node" or "npm" being available globally on the computer. Using this option, these other plugins will automatically find the node/npm version that has been downloaded. Please note that the PATH is only set for the duration of the Composer script. Your global environment is not impacted by this option.
    This option is only available in the root package.
    Default value: false

Custom script

The installer listens to the following composer scripts to be launched:, (*10)

{
    "post-install-cmd": {
        // ...
    },
    "post-update-cmd": {
        // ...
    }
}

If you need to launch the installer manually, you can run the following command:, (*11)

$ composer run-script download-nodejs

The Versions

16/04 2018

1.0.x-dev

1.0.9999999.9999999-dev http://mouf-php.com/packages/mouf/nodejs-installer

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

  Sources   Download

MIT

The Requires

  • php >=5.3.0
  • ext-openssl *
  • composer-plugin-api ^1.0.0

 

The Development Requires

installer nodejs npm

16/04 2018

v1.0.13

1.0.13.0 http://mouf-php.com/packages/mouf/nodejs-installer

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

  Sources   Download

MIT

The Requires

  • php >=5.3.0
  • composer-plugin-api ^1.0.0
  • ext-openssl *

 

The Development Requires

installer nodejs npm

17/11 2016

v1.0.12

1.0.12.0 http://mouf-php.com/packages/mouf/nodejs-installer

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

  Sources   Download

MIT

The Requires

  • php >=5.3.0
  • composer-plugin-api ^1.0.0
  • ext-openssl *

 

The Development Requires

installer nodejs npm

07/10 2016

v1.0.11

1.0.11.0 http://mouf-php.com/packages/mouf/nodejs-installer

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

  Sources   Download

MIT

The Requires

  • php >=5.3.0
  • composer-plugin-api ^1.0.0
  • ext-openssl *

 

The Development Requires

installer nodejs npm

05/01 2016

v1.0.10

1.0.10.0 http://mouf-php.com/packages/mouf/nodejs-installer

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

  Sources   Download

MIT

The Requires

  • php >=5.3.0
  • composer-plugin-api ^1.0.0
  • ext-openssl *

 

The Development Requires

installer nodejs npm

18/11 2015

v1.0.9

1.0.9.0 http://mouf-php.com/packages/mouf/nodejs-installer

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

  Sources   Download

MIT

The Requires

  • php >=5.3.0
  • composer-plugin-api ^1.0.0
  • ext-openssl *

 

The Development Requires

installer nodejs npm

16/09 2015

v1.0.8

1.0.8.0 http://mouf-php.com/packages/mouf/nodejs-installer

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

  Sources   Download

MIT

The Requires

  • php >=5.3.0
  • composer-plugin-api ^1.0.0
  • ext-openssl *

 

The Development Requires

installer nodejs npm

10/09 2015

v1.0.7

1.0.7.0 http://mouf-php.com/packages/mouf/nodejs-installer

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

  Sources   Download

MIT

The Requires

  • php >=5.3.0
  • composer-plugin-api ^1.0.0
  • ext-openssl *

 

The Development Requires

installer nodejs npm

15/06 2015

v1.0.6

1.0.6.0 http://mouf-php.com/packages/mouf/nodejs-installer

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

  Sources   Download

MIT

The Requires

  • php >=5.3.0
  • composer-plugin-api ^1.0.0
  • ext-openssl *

 

The Development Requires

installer nodejs npm

27/04 2015

v1.0.5

1.0.5.0 http://mouf-php.com/packages/mouf/nodejs-installer

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

  Sources   Download

MIT

The Requires

  • php >=5.3.0
  • composer-plugin-api ~1.0.0
  • ext-openssl *

 

The Development Requires

installer nodejs npm

24/04 2015

v1.0.4

1.0.4.0 http://mouf-php.com/packages/mouf/nodejs-installer

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

  Sources   Download

MIT

The Requires

  • php >=5.3.0
  • composer-plugin-api ~1.0.0
  • ext-openssl *

 

The Development Requires

installer nodejs npm

23/04 2015

v1.0.3

1.0.3.0 http://mouf-php.com/packages/mouf/nodejs-installer

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

  Sources   Download

MIT

The Requires

  • php >=5.3.0
  • composer-plugin-api ~1.0.0
  • ext-openssl *

 

The Development Requires

installer nodejs npm

12/04 2015

v1.0.2

1.0.2.0 http://mouf-php.com/packages/mouf/nodejs-installer

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

  Sources   Download

MIT

The Requires

  • php >=5.3.0
  • composer-plugin-api ~1.0.0
  • ext-openssl *

 

The Development Requires

installer nodejs npm

24/03 2015

v1.0.1

1.0.1.0 http://mouf-php.com/packages/mouf/nodejs-installer

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

  Sources   Download

MIT

The Requires

  • php >=5.3.0
  • composer-plugin-api ~1.0.0
  • ext-openssl *

 

The Development Requires

installer nodejs npm

12/03 2015

v1.0.0

1.0.0.0 http://mouf-php.com/packages/mouf/nodejs-installer

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

  Sources   Download

MIT

The Requires

  • php >=5.3.0
  • composer-plugin-api ~1.0.0
  • ext-openssl *

 

The Development Requires

installer nodejs npm

11/03 2015

v0.1.0

0.1.0.0 http://mouf-php.com/packages/mouf/nodejs-installer

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

  Sources   Download

MIT

The Requires

  • php >=5.3.0
  • composer-plugin-api ~1.0.0

 

installer nodejs npm