1.0.0 • Published 7 years ago

alternate-screen v1.0.0

Weekly downloads
5
License
MIT
Repository
github
Last release
7 years ago

alternate-screen

Utility to switch terminal screens. Read question on SO

Installation

npm install --save alternate-screen

Usage

Node.JS:

const { show, hide } = require('alternate-screen')

console.log('In the main screen')

show()

console.log('In alternate screen')

hide()

console.log('Again in main screen')

Babel:

import { show, hide } from 'alternate-screen'

console.log('In the main screen')

show()

console.log('In alternate screen')

hide()

console.log('Again in main screen')

API

show and showAlternateScreen

Write to terminale escape sequence to switch screen to alternate.

hide and hideAlternateScreen

Write to terminale escape sequence to switch screen back to main.

Example

Clone repository and run:

node ./test.js

License

MIT @ Sergey Sova