Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/garthenweb/node-composer-runner
Node.js wrapper for composer package manager (php)
https://github.com/garthenweb/node-composer-runner
composer npm
Last synced: 1 day ago
JSON representation
Node.js wrapper for composer package manager (php)
- Host: GitHub
- URL: https://github.com/garthenweb/node-composer-runner
- Owner: garthenweb
- License: mit
- Created: 2015-11-22T15:34:40.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2021-08-14T15:15:40.000Z (over 3 years ago)
- Last Synced: 2024-09-19T23:39:43.707Z (about 2 months ago)
- Topics: composer, npm
- Language: JavaScript
- Size: 9.77 KB
- Stars: 3
- Watchers: 2
- Forks: 1
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# node-composer-runner
A node.js wrapper for the php package manager [composer](https://github.com/composer/composer).
## Motivation
In times where you have complex build chains for your frontend environment based on NodeJS but interchangeable backend systems, NPM is a good choice to unify processes across your projects. I am working with different backend systems in my daily business but NPM is the foundation in all projects to perform common tasks. One of them is the installment of all dependencies for frontend and backend.
When using a NPM run scripts to install php dependencies via composer you need to be sure to have composer installed on your system. This can be a little bit complicated to do for a php nooby. To reduce local dependencies on your development environment it would be great to have a NPM package that will handle composer installment and versions management of composer itself for you. This package will do exactly that.
## Dependencies
This package will not reduce the dependency of php to be installed on your environment. Be sure to have php installed and available in your PATH environment.
## Usage
You should install this package into your project and call it from your npm run scripts.
It is also possible to install it globally but that would have no benefit because the primary goal is to remove global dependencies on the developers local environment.
``` base
npm install --save-dev node-composer-runner
```Then you can use it in the package.json as a node run script:
``` json
{
...
"scripts": {
"postinstall": "composer-runner -- install"
}
}
```### CLI
You can run composer via ``composer-runner``. Use ``--`` to forward commands directly to composer.
Some examples:
``` base
composer-runner -- install --dry-run
composer-runner -- -v
```### Versions
By default every version of node-composer-runner is bundled with a predefined specific composer version, to be sure the repository is independent for breaking changes to the composer library.
If the specified version is out of date, you can override it in your package json:
``` json
{
...
"engines": {
"composer": "1.0.0-alpha11"
}
}
```You can defined any version that is accessible on the composer server like ``https://getcomposer.org/download//composer.phar``.