summaryrefslogtreecommitdiff
path: root/deps/npm/node_modules/npmlog/node_modules/ansi/examples/clear/index.js
blob: 6ac21ffa99f87adfd92a00b690834e569f36ebfc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/usr/bin/env node

/**
 * Like GNU ncurses "clear" command.
 * https://github.com/mscdex/node-ncurses/blob/master/deps/ncurses/progs/clear.c
 */

process.title = 'clear'

function lf () { return '\n' }

require('../../')(process.stdout)
  .write(Array.apply(null, Array(process.stdout.getWindowSize()[1])).map(lf).join(''))
  .eraseData(2)
  .goto(1, 1)