Download the PHP package oat-sa/composer-npm-bridge without Composer

On this page you can find all versions of the php package oat-sa/composer-npm-bridge. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package composer-npm-bridge

Composer NPM bridge

NPM integration for Composer packages.

This package is a fork from https://github.com/eloquent/composer-npm-bridge (thanks to them!)

Installation

Requirements

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 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?

The Composer NPM bridge is a Composer plugin that automatically installs and updates NPM 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 NPM dependencies for all Composer packages using the bridge. This includes the root package, as well as Composer dependencies.

Similarly, composer update will install 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

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.

Key Type Default Description
timeout int 300 Specify a custom timeout for the installation (in seconds).
optional bool false Skip instead of throwing an exception if npm is not found when processing the package.
arguments array [] Add custom NPM arguments

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

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.


All versions of composer-npm-bridge with dependencies

PHP Build Version
Package Version
Requires php Version >=5.6
composer-plugin-api Version ^1.0 || ^2.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package oat-sa/composer-npm-bridge contains the following files

Loading the files please wait ....