Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

debug-proc

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

debug-proc

Show a process output with `debug` utility

  • 0.1.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

debug-proc

Show a process output with debug utility.

Installation

npm install debug-proc

Usage

Running node with the appropriate environment vars (DEBUG=proc in this example):

var debugProc = require('debug-proc')('proc');

var proc = spawn('./script.sh', ['abc', 123]);

debugProc(proc);
/*
proc  ./script.sh abc 123 +0ms
proc  stdout message 1 +10ms
proc  stderr message 1 +3ms
proc  stdout message 2 +46ms
proc  stderr message 2 +1ms
*/

// the process spawn args, stderr and stdout can be disabled
debugProc(proc, {spawnargs: false, stdout: false});
/*
proc  stderr message 1 +3ms
proc  stderr message 2 +1ms
*/

debugProc(proc, {decorate: 'name'});
/*
proc  ./script.sh: ./script.sh abc 123 +0ms
proc  ./script.sh: stdout message 1 +10ms
proc  ./script.sh: stderr message 1 +3ms
proc  ./script.sh: stdout message 2 +46ms
proc  ./script.sh: stderr message 2 +1ms
*/

debugProc(proc, {decorate: 'pid'});
/*
proc  pid 10425: ./script.sh abc 123 +0ms
proc  pid 10425: stdout message 1 +10ms
proc  pid 10425: stderr message 1 +3ms
proc  pid 10425: stdout message 2 +46ms
proc  pid 10425: stderr message 2 +1ms
*/

debugProc(proc, {
  decorate: function(proc) {
    return 'process-description: ';
  }
});
/*
proc  process-description: ./script.sh abc 123 +0ms
proc  process-description: stdout message 1 +10ms
proc  process-description: stderr message 1 +3ms
proc  process-description: stdout message 2 +46ms
proc  process-description: stderr message 2 +1ms
*/

Run examples

cd examples/
DEBUG=proc node example.js

License

MIT license - http://www.opensource.org/licenses/mit-license.php

Keywords

FAQs

Package last updated on 09 Dec 2016

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc