node package manager
Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »


drush for node.js

This is a simple node.js wrapper for running drush commands.

To use:

var drush = require('drush');
  function () {
        function (res) {

The module is built on top of promised-io and exec returns a promise object. Chaining commands can therefore be conveniently done as follows:

var group = require('promised-io/promise').all([
  drush.exec('cc all')
group.then(function (res) {

You must call Drush.init() before executing other commands, but as long as the Drush object remains in scope you only need to call it once.

Advanced options

You may pass additional options to the underlaying exec commands by calling init with a hash of appropriate options:

drush.init({ maxBuffer: 256 * 1024 * 1024 })

Note: You may need to increase the buffer size for commands that return a lot of output.