title: How to clear screen using node/npm blessed (curses-like library)
body: <p>I am using node/npm blessed to create a screen to monitor a particular application and I want the monitor tool to look/act like linux top.  The problem I have, which I think is relatively simple (but I cant find the answer anywhere), is to have blessed clear the screen at startup as well as at particular points based upon user input.</p>
  
  <p>Right now I can use blessed to paint the screen properly (sample program below), but the problem is I need the screen to be cleared at startup (right now the first line of output just appends right after you start up the program):</p>
  
  <pre><code>var blessed = require('blessed');
  
  var screen = blessed.screen(),
      body = blessed.box({
        top: 0,
        left: 0,
        width: '100%',
        height: '100%',
        tags: true
      });
  
  var items = [];
  
  screen.append(body);
  
  screen.key(['escape', 'q', 'C-c'], function(ch, key) {
    return process.exit(0);
  });
  
  function log(text) {
    items.push(text);
  
    var MAX = 10;
    if( items.length &gt; MAX+1 ){
      items.shift();
    }
  
    for (var i=1; i&lt;MAX; i++){
      body.setLine(i, items[i]);
    }
    screen.render();
  
  }
  
  function status(text) {
    body.setLine(0, text );
    screen.render();
  }
  
  var counter = 1;
  setInterval(function() {
    status((new Date()).toISOString());
    log('Line number: ' + (counter++));
  }, 1000);
  </code></pre>