{"id":13803542,"url":"https://github.com/thecodingmachine/nodejs-installer","last_synced_at":"2025-06-29T14:33:05.042Z","repository":{"id":28265804,"uuid":"31776085","full_name":"thecodingmachine/nodejs-installer","owner":"thecodingmachine","description":"An installer package that let's you install NodeJS and NPM as a Composer dependency.","archived":false,"fork":false,"pushed_at":"2022-08-25T15:14:50.000Z","size":83,"stargazers_count":107,"open_issues_count":11,"forks_count":28,"subscribers_count":16,"default_branch":"1.0","last_synced_at":"2025-06-22T03:56:32.070Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/thecodingmachine.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-03-06T15:42:02.000Z","updated_at":"2024-09-02T10:45:51.000Z","dependencies_parsed_at":"2022-08-07T13:15:37.438Z","dependency_job_id":null,"html_url":"https://github.com/thecodingmachine/nodejs-installer","commit_stats":null,"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"purl":"pkg:github/thecodingmachine/nodejs-installer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thecodingmachine%2Fnodejs-installer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thecodingmachine%2Fnodejs-installer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thecodingmachine%2Fnodejs-installer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thecodingmachine%2Fnodejs-installer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thecodingmachine","download_url":"https://codeload.github.com/thecodingmachine/nodejs-installer/tar.gz/refs/heads/1.0","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thecodingmachine%2Fnodejs-installer/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262609377,"owners_count":23336690,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-04T01:00:35.128Z","updated_at":"2025-06-29T14:33:05.001Z","avatar_url":"https://github.com/thecodingmachine.png","language":"PHP","funding_links":[],"categories":["PHP","Plugins"],"sub_categories":["Support"],"readme":"[![Latest Stable Version](https://poser.pugx.org/mouf/nodejs-installer/v/stable.svg)](https://packagist.org/packages/mouf/nodejs-installer)\n[![Latest Unstable Version](https://poser.pugx.org/mouf/nodejs-installer/v/unstable.svg)](https://packagist.org/packages/mouf/nodejs-installer)\n[![License](https://poser.pugx.org/mouf/nodejs-installer/license.svg)](https://packagist.org/packages/mouf/nodejs-installer)\n[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/thecodingmachine/nodejs-installer/badges/quality-score.png?b=1.0)](https://scrutinizer-ci.com/g/thecodingmachine/nodejs-installer/?branch=1.0)\n\nNodeJS installer for Composer\n=============================\n\nThis is an installer that will download NodeJS and NPM and install them in your Composer dependencies.\nInstallation is skipped if NodeJS is already available on your machine.\n\nWhy?\n----\n\nNodeJS is increasingly becoming a part of the tool-chain of modern web developers. Tools like Bower, Grunt, Gulp... are\nused everyday to build applications. For the PHP developer, this means PHP projects have build dependencies on NodeJS\nor Bower / NPM packages. The NodeJS-installer attempts to bridge the gap between NodeJS and PHP by making NodeJS easily \ninstallable as a Composer dependency.\n\nBuilding on this package, other packages like [koala-framework/composer-extra-assets](https://github.com/koala-framework/composer-extra-assets)\ncan be used to automatically fetch Bower / NPM packages, run Gulp / Grunt tasks, etc...\n\nHow does it work?\n-----------------\n\nSimply include this package in your `composer.json` requirements:\n\n```json\n{\n    \"require\": {\n        \"mouf/nodejs-installer\": \"~1.0\"\n    }\n}\n```\n\nBy default, if NodeJS is not available on your computer, it will be downloaded and installed in *vendor/nodejs/nodejs*.\n\nYou should access NodeJS and NPM using the scripts created into the *vendor/bin* directory:\n\n- *vendor/bin/node* (*vendor/bin/node.bat* on Windows)\n- *vendor/bin/npm* (*vendor/bin/npm.bat* on Windows)\n\nOptions\n-------\n\nA number of options are available to customize NodeJS installation:\n\n\n```json\n{\n    \"require\": {\n        \"mouf/nodejs-installer\": \"~1.0\"\n    },\n    \"extra\": {\n        \"mouf\": {\n            \"nodejs\": {\n                \"version\": \"~0.12\",\n                \"targetDir\": \"vendor/nodejs/nodejs\",\n                \"forceLocal\": false\n            }\n        }\n    }\n}\n```\n\nAvailable options:\n\n- **version**: This is the version number of NodeJS that will be downloaded and installed.\n  You can specify version constraints in the usual Composer format (for instance \"~0.12\" or \"\u003e0.11\").  \n  _Default value: *_ The latest stable version of NodeJS is installed by default.\n- **targetDir**: The target directory NodeJS will be installed in. Relative to project root.  \n  This option is only available in the root package.  \n  *Default value: vendor/nodejs/nodejs*\n- **forceLocal** (boolean): If set to true, NodeJS will always be downloaded and installed locally, even if NodeJS\n  is already available on your computer.  \n  This option is only available in the root package.  \n  *Default value: false*\n- **includeBinInPath** (boolean): After the plugin is run in Composer, the *vendor/bin* directory can optionally be \n  added to the PATH. This is useful if other plugins rely on \"node\" or \"npm\" being available globally on the \n  computer. Using this option, these other plugins will automatically find the node/npm version that has been \n  downloaded. Please note that the PATH is only set for the duration of the Composer script. Your global environment\n  is not impacted by this option.  \n  This option is only available in the root package.  \n  *Default value: false*\n\n\nCustom script\n-------------\n\nThe installer listens to the following composer scripts to be launched:\n```\n{\n    \"post-install-cmd\": {\n        // ...\n    },\n    \"post-update-cmd\": {\n        // ...\n    }\n}\n```\n\nIf you need to launch the installer manually, you can run the following command:\n```\n$ composer run-script download-nodejs\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthecodingmachine%2Fnodejs-installer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthecodingmachine%2Fnodejs-installer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthecodingmachine%2Fnodejs-installer/lists"}