Spawn long running processes.

Usage no npm install needed!

<script type="module">
  import gruntLongrunning from '';



Spawn multiple long running processes in a single grunt task.

Also features listening for changes in files, and restarting the process.

Getting Started

This plugin requires Grunt ~0.4.2

If you haven't used Grunt before, be sure to check out the Getting Started guide, as it explains how to create a Gruntfile as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:

npm install grunt-longrunning --save-dev

Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:


The "longrunning" task


In your project's Gruntfile, add a section named longrunning to the data object passed into grunt.initConfig().

  longrunning: {
    all: {
      commands: [
          cmd: 'node',
          args: [ 'server1.js' ]
          files: [
            // Files don't need to be `server1`-specific. The following is
            // simply an example.
          cmd: 'node',
          args: [ 'server2.js' ]



Type: Array Required

An array of of commadns


Type: String (required)

The command name.


Type: Array Default: []

The arguments to pass to the command.


Type: Array or String Default: undefined

A single glob pattern, or an array of glob patterns. Used for listening to changes made to files that match the glob pattern or patterns.


In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using Grunt.

Release History

v0.0.0 January 19, 2014

Initial release