Socket
Book a DemoInstallSign in
Socket

fake-exec

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fake-exec

Fake child_process#exec output

latest
Source
npmnpm
Version
1.1.0
Version published
Maintainers
1
Created
Source

fake-exec Circle CI

Fake child_process#exec output for testing.

Installation

$ npm install fake-exec --save

Usage

// include dependencies
const fake = require('fake-exec');
const exec = require('child_process').exec;

// set up a fake command
fake('rm -rf /', 'no, thank you');

// execute a command using native child_process#exec method
exec('rm -rf /', function (err, stdout) {
  stdout === 'no, thank you'; // true
});

Check out tests (they look good) for more examples.

Tests

Circle CI

$ make test

License

fake-exec is released under the MIT license.

Keywords

mock-exec

FAQs

Package last updated on 01 Aug 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts