NPM
This module provides tools to interact with NPM and its associated package managers like Yarn. It allows Drupal to find and utilize available package manager executables for various tasks.
Provides tools to interact with NPM.
Usage
/** @var Drupal\npm\Plugin\NpmExecutableInterface $npmExecutable */
$npmExecutable = \Drupal::service('plugin.manager.npm_executable')->getExecutable();
Details
Right now yarn is the only supported executable. Others can be added by implementing NpmExecutable Plugins. Each plugin has a weight that determines its priority and an isAvailable method that tells if it's operational (e.g. yarn is installed). The plugin manager's getExecutable method returns the first available executable.
Related modules
Depends on
Dependencies of the latest stable release
No dependencies recorded for this project.
Required by
Tracked projects that depend on this one
No tracked projects depend on this one yet.
Activity
Releases
| Version | Type | Core | Notes | Release date | |
|---|---|---|---|---|---|
| 3.0.1 | Stable | 9–11 | Sep 4, 2025 |