npm

Ready to take your JavaScript development to the next level? Meet npm Enterprise - the ultimate in enterprise JavaScript. Learn more »

cross-clear

1.0.0 • Public • Published

cross-clear

Modern cross-platform terminal screen clearing.

This module uses Node's official readline API so it works reliably in all terminals on all platforms. The used functions (readline.cursorTo and readline.clearScreenDown) are available since Node v0.12.0.

Installation

npm install cross-clear

Quickstart

const clear = require('cross-clear')
 
clear() // clears stdout
clear(process.stderr) // clears stderr

API

clear([stream])

  • Clears the given stream; if no stream is provided, process.stdout will be cleared
  • Gracefully does nothing if not run in a text terminal (stream.isTTY) or if the provided stream is not writable (stream.writable)

CLI

$ cross-clear

License

WTFPL – Do What the F*ck You Want to Public License.

Made with ❤️ by @MarkTiedemann.

install

npm i cross-clear

Downloadsweekly downloads

32

version

1.0.0

license

WTFPL

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability