# screenliner

> node util for writing to regions on the terminal

Latest version **0.1.2** (published 2014-10-01) · MIT license · 0 weekly downloads

## Install

```sh
npm install screenliner
pnpm add screenliner
yarn add screenliner
bun add screenliner
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.2 |
| Published | 2014-10-01 |
| First published | 2014-09-30 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 40 |
| Author | Moshe Kolodny |
| Maintainers | kolodny |
| Keywords | stream, cli, clearLine, moveCursor, cursorTo, stdout |

## Links

- npm: https://www.npmjs.com/package/screenliner
- Repository: https://github.com/kolodny/screenliner
- Issues: https://github.com/kolodny/screenliner/issues
- npm.io page: https://npm.io/package/screenliner

## Alternatives

- [@salesforce/cli](https://npm.io/package/@salesforce/cli.md) — 389.7K weekly downloads
- [@mintlify/cli](https://npm.io/package/@mintlify/cli.md) — 208.9K weekly downloads
- [@grafana/e2e-selectors](https://npm.io/package/@grafana/e2e-selectors.md) — 128.7K weekly downloads
- [mintlify](https://npm.io/package/mintlify.md) — 112.0K weekly downloads
- [@intlayer/cli](https://npm.io/package/@intlayer/cli.md) — 22.8K weekly downloads

## Recent versions

- 0.1.2 (latest) — 2014-10-01
- 0.1.1 — 2014-10-01
- 0.1.0 — 2014-09-30
- 0.0.1 — 2014-09-30
- 0.0.0 — 2014-09-30

## README

Screenliner
===

### example usage:

test.js:

```js
var Screenliner = require('./');
var screenliner = new Screenliner();
var Promise = require('bluebird');
var fs = require('fs');

var lineStr = new Array(screenliner.width + 1).join('-');

screenliner.createRegion(lineStr);
var top = screenliner.createRegion();
screenliner.createRegion(lineStr);
var middle = screenliner.createRegion()
var middle2 = screenliner.createRegion()
screenliner.createRegion(lineStr);
var bottom = screenliner.createRegion();
screenliner.createRegion(lineStr);

var sleep = function(ms) {
  return new Promise(function(res) { setTimeout(res, ms); });
}

top.print('This is top - pending');
middle.print('This is middle - pending');
middle2.print('This is middle2 - status - ');
bottom.print('This is bottom - pending');

var timers = [];
timers.push(sleep(Math.random() * 3000).then(function() {
  top.replace('pending', '√');
}));

timers.push(sleep(Math.random() * 3000).then(function() {
  middle.replace(/pending/, '√');
}))
timers.push(sleep(Math.random() * 3000).then(function() {
  middle2.print('√', true); // appends
}))

timers.push(sleep(Math.random() * 3000).then(function() {
  bottom.print('√'); // replaces
}));

Promise.all(timers).then(function() {
  return sleep(500);
}).then(function() {
  fs.writeFileSync('screen.txt', screenliner.getScreenState().join('\n'));
  console.log('done!');
});

```

Produces:
![demo](demo.gif)

---
_Source: https://npm.io/package/screenliner · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
