Menu

gitpiper

process Cheat Sheet in December 2024

Last Updated: 17 December 2024

README.md

Streams

process.stdout.write('...');
process.stderr.write('...');

function stdin(fn) {
  var data = '';

  process.stdin.setEncoding('utf8');
  process.stdin.on('readable', function() {
    var chunk = process.stdin.read();
    if (chunk !== null) data += chunk;
  });

  process.stdin.on('end', function() {
    fn(null, data);
  });
}

stuff

process.argv; //=> ['node', 'file.js', 'one', 'two']
process.env; //=> {TERM: 'screen-256color', SHELL: '/bin/bash', ...}

process.exit();
process.exit(1);

Directories

process.cwd(); //=> "/tmp"
process.chdir('dir');

References


338+ more cheat sheets for you in December 2024

Subscribe to our Newsletter

Subscribe to get resources directly to your inbox. You won't receive any spam! ✌️

© 2024 GitPiper. All rights reserved

Rackpiper Technology Inc

Company

About UsBlogContact

Subscribe to our Newsletter

Subscribe to get resources directly to your inbox. You won't receive any spam! ✌️