From de115e3a21488631d378ac73a56f04c43b36c4db Mon Sep 17 00:00:00 2001 From: Jeff Geerling Date: Tue, 22 Sep 2015 09:55:54 -0500 Subject: [PATCH] Fixes #227: Document Nodejs usage and Node/Ruby inclusion. --- README.md | 2 ++ docs/extras/nodejs.md | 20 ++++++++++++++++++++ mkdocs.yml | 1 + 3 files changed, 23 insertions(+) create mode 100644 docs/extras/nodejs.md diff --git a/README.md b/README.md index bbd520e88..232146370 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,9 @@ It will install the following on an Ubuntu 14.04 (by default) linux VM: - Optional: - Varnish 4.x - Apache Solr 4.10.x (configurable) + - Node.js - Selenium, for testing your sites via Behat + - Ruby - Memcached - XHProf, for profiling your code - XDebug, for debugging your code diff --git a/docs/extras/nodejs.md b/docs/extras/nodejs.md new file mode 100644 index 000000000..132b59cab --- /dev/null +++ b/docs/extras/nodejs.md @@ -0,0 +1,20 @@ +Node.js is used for many different purposes, but with Drupal, it is most often used as part of a toolset for Front End development or certain CI tasks. + +Drupal VM includes built-in support for Node.js—all you need to do is make sure `nodejs` is listed in the list of `installed_extras` inside `config.yml` before your provision Drupal VM. + +## Choosing a version of Node.js + +You can choose a version of Node.js to install using the `nodejs_version` variable in `config.yml`. See the `geerlingguy.nodejs` role documentation for all the currently-available versions for your OS. + +```yaml +nodejs_version: "0.12" +``` + +## Installing global packages via NPM + +To install packages globally, you can add them to the list of `nodejs_npm_global_packages` in `config.yml`. As an example, many developers use `phantomjs` as a ghost web driver for Behat tests inside Drupal VM. To install it globally, add it to the list: + +```yaml +nodejs_npm_global_packages: + - name: phantomjs +``` diff --git a/mkdocs.yml b/mkdocs.yml index 62b9a8aca..5c29f2c6a 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -22,6 +22,7 @@ pages: - 'Use Drupal Console with Drupal VM': 'extras/drupal-console.md' - 'Use Varnish with Drupal VM': 'extras/varnish.md' - 'Use MariaDB instead of MySQL': 'extras/mariadb.md' + - 'Use Node.js and NPM': 'extras/nodejs.md' - 'View Logs with Pimp my Log': 'extras/pimpmylog.md' - 'Profile Code with XHProf': 'extras/xhprof.md' - 'Debug Code with XDebug': 'extras/xdebug.md'