-
Notifications
You must be signed in to change notification settings - Fork 1
/
README.html
20 lines (16 loc) · 1.04 KB
/
README.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
<p>Provides tools to interact with NPM.</p>
<h2>Usage</h2>
<code>
/** @var Drupal\npm\Plugin\NpmExecutableInterface $npmExecutable */
$npmExecutable = \Drupal::service('plugin.manager.npm_executable')->getExecutable();
</code>
<h2>Details</h2>
Right now <code>yarn</code> is the only supported executable. Others can be added by implementing <code>NpmExecutable</code> Plugins. Each plugin has a weight that determines its priority and an <code>isAvailable</code> method that tells if it's operational (e.g. yarn is installed). The plugin manager's <code>getExecutable</code> method returns the first available executable.
<ul>
<li><a href="https://github.com/drupal-webpack/npm/blob/8.x-1.x/src/Plugin/NpmExecutableInterface.php" target="_blank">The plugin interface</a></li>
<li><a href="https://github.com/drupal-webpack/npm/blob/8.x-1.x/src/Plugin/NpmExecutable/Yarn.php" target="_blank">Example implementation</a></li>
</ul>
<h2>Related modules</h2>
<ul>
<li><a href="https://drupal.org/project/webpack" target="_blank">Webpack</a></li>
</ul>