# clivas

> use your terminal as a canvas. features easy redrawing, colors and more

Latest version **0.2.0** (published 2015-03-27) · 0 weekly downloads

## Install

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

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.0 |
| Published | 2015-03-27 |
| First published | 2012-09-24 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 49 |
| Author | Mathias Buus Madsen |
| Maintainers | mafintosh |
| Keywords | canvas, cli, console, terminal |

## Links

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

## 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.2.0 (latest) — 2015-03-27
- 0.1.4 — 2013-03-01
- 0.1.3 — 2012-09-26
- 0.1.2 — 2012-09-25
- 0.1.1 — 2012-09-24
- 0.1.0 — 2012-09-24

## README

# clivas

Turn your terminal into a canvas.

It is available through npm:

	npm install clivas

## Usage

It is easy to use

``` js
var clivas = require('clivas');

var frame = 0;

setInterval(function() {
	clivas.clear(); // clears the canvas
	clivas.line('hello world (#frame '+frame+')');
	clivas.line('{red:also} {green:colors}!');
	frame++;
}, 200);
```

When you draw something with clivas you can use the format patten to help you

``` js
clivas.line('{red:i am red} and {blue: i am blue}');
```

If you wanted to inverse a color you would provide the inverse tag

``` js
clivas.line('{red+inverse:i am inversed}');
```

The format pattern can also help you add whitespace

``` js
clivas.line('[{10:===>}]'); // prints [===>      ]
```

## API

* `clivas.clear()` - Clears the screen. If you called `clivas.pin()` it would only clear up until the pin.

* `clivas.flush()` - Clears everything below the cursor.

* `clivas.pin([lineNumber])` - Only clear to here when `clivas.clear()` is called

* `clivas.line(str)` - Write a line (accepts a format string as described above)

* `clivas.write(str)` - Same as `clivas.line(str)` except it does not add a newline

* `clivas.cursor(enable)` - Enable or disable the terminal cursor

* `clivas.alias(name, value)` - Add an alias to the format pattern i.e. `clivas.alias('link', 'red+underline')` enables you to use `{link:http://google.com}`

## License

MIT

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