1.1.0 • Published 8 years ago

fm-exec v1.1.0

Weekly downloads
4
License
MIT
Repository
github
Last release
8 years ago

fm-exec

npm.io Coverage Status Code Climate GitHub license

What?

Helper to spawn external applications.

  • uses child_process.spawn() by default (using the shell is also possible, with exec.shell)
  • uses promises
  • allows you to use the same signature for spawn and exec calls
  • conveniently buffers process output, if desired

How?

Install

npm install fm-exec

Usage

var exec = require( "fm-exec" );

// Just run a binary. Returns a promise.
exec( "notepad" );

// Run a binary with arguments.
exec( "notepad", [ "foo.txt" ] );

// Buffer application output to receive it in resolution/rejection handler.
exec( "git", [ "rev-parse", "HEAD" ], {
	cwd    : applicationDirectory,
	buffer : true
} )
	.then( function echoVersion( version ) {
		console.log( version );
	} )
	.catch( function onError( error ) {
		// handle error
	} );

// Execute a command through the shell.
exec.shell( "notepad", [ "foo.txt" ] );
// When using exec.shell, this call is identical to the one above.
exec.shell( "notepad foo.txt" );
1.1.0

8 years ago

1.0.5

9 years ago

1.0.4

9 years ago

1.0.3

9 years ago

1.0.2

9 years ago

1.0.1

9 years ago

1.0.0

9 years ago

0.0.9

9 years ago

0.0.8

9 years ago

0.0.7

9 years ago

0.0.6

9 years ago

0.0.5

9 years ago

0.0.4

9 years ago

0.0.3

9 years ago

0.0.2

9 years ago

0.0.1

9 years ago