Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

212
Views
How can I capture stdout and stderr in the browser?

I'm trying to figure out how to capture stderr and stdout in the browser from the currently executing javascript.

This will be for a live code editor.

about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

JS has no stdout or stderr - it just has the console.

It is possible to override console.log() with your own function that does whatever processing you want, and ideally then pass the log message to the original console.log function. Ditto for console.error.

For example:

(function() {
    const log_orig = console.log;

    console.log = function() {
        log_orig.call(console, 'log called with ' arguments.length + ' parameters');
        log_orig.apply(console, arguments);
    }
})();  // IIFE
about 4 years ago · Juan Pablo Isaza Report

0

You can't.

Any output and errors that browser outputs are not exposed to JS.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!