Skip to content

elliotttf/drush-node

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

drush for node.js

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

To use:

var drush = require('drush-node');

drush.init().then(
  function () {
    drush.exec('updb')
      .then(
        function (res) {
          console.log(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.init(),
  drush.exec('updb'),
  drush.exec('fra'),
  drush.exec('cc all')
]);

group.then(function (res) {
  console.log(res.join("\r"));
});

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.

About

A simple node.js wrapper for running drush commands.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published