Skip to content

Latest commit

 

History

History
65 lines (37 loc) · 951 Bytes

readme.md

File metadata and controls

65 lines (37 loc) · 951 Bytes

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