# drawille

> Drawing in terminal with unicode braille characters

Latest version **2.0.2** (published 2022-10-16) · MIT license · 0 weekly downloads

## Install

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

## Health

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

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.2 |
| Published | 2022-10-16 |
| First published | 2014-05-05 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 6.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1031 |
| Author | Bence Dányi |
| Maintainers | lennon, a1rpun |
| Keywords | draw, canvas, braille, terminal |

## Links

- npm: https://www.npmjs.com/package/drawille
- Repository: https://github.com/madbence/node-drawille
- Homepage: https://github.com/madbence/node-drawille#readme
- Issues: https://github.com/madbence/node-drawille/issues
- npm.io page: https://npm.io/package/drawille

## Alternatives

- [localforage](https://npm.io/package/localforage.md) — 6.2M weekly downloads
- [localforage-observable](https://npm.io/package/localforage-observable.md) — 30.8K weekly downloads
- [@y/y](https://npm.io/package/@y/y.md) — 30.1K weekly downloads
- [@metaobjectsdev/render](https://npm.io/package/@metaobjectsdev/render.md) — 3.5K weekly downloads
- [@ledgerhq/coin-algorand](https://npm.io/package/@ledgerhq/coin-algorand.md) — 1.1K weekly downloads

## Recent versions

- 2.0.2 (latest) — 2022-10-16
- 2.0.1 — 2022-10-16
- 1.1.1 — 2019-08-05
- 1.1.0 — 2015-11-01
- 1.0.1 — 2015-10-29
- 1.0.0 — 2014-07-30
- 0.1.1 — 2014-06-19
- 0.1.0 — 2014-06-12
- 0.0.4 — 2014-06-11
- 0.0.3 — 2014-05-21
- 0.0.2 — 2014-05-05
- 0.0.1 — 2014-05-05

## README

# node-drawille [![Build Status](https://travis-ci.org/madbence/node-drawille.svg)](https://travis-ci.org/madbence/node-drawille)

> drawing in terminal with [unicode braille][] characters. The idea is based on [drawille](https://github.com/asciimoo/drawille) by @asciimoo.

![cube](cube.gif)

## install

install the [package](https://npmjs.com/drawille) with `npm`:

```
$ npm install --save drawille
```

## usage

See [examples](examples).

this module provides a very basic API only, for fancy things, like drawing lines, use another module, like [`bresenham`](https://github.com/madbence/node-bresenham).

[`drawille-canvas`](https://github.com/madbence/node-drawille-canvas) provides HTML5 Canvas API for drawille.

## api

### `Canvas(w, h)`

Create a new canvas with the given dimensions.
`w` must be multiple of 2, `h` must be multiple of 4.
Uses `columns` & `rows` from `process.stdout` as default values for `w` and `h`.

### `canvas.set(x, y)`

Draw point on `canvas` at the given position.

### `canvas.unset(x, y)`

Delete point on `canvas` at the given position.

### `canvas.toggle(x, y)`

Toggle point on `canvas` at the given position.

### `canvas.clear()`

Clear the whole canvas (delete every point).

### `canvas.frame(delimiter)`

return the current content of `canvas`, as a `delimiter`-delimited
string. `delimiter` defaults to `\n`.

it uses braille characters to represent points,
so every line has length of `w/2`, and the string contains `h/4`
lines.

## projects

- [`vtop`](https://github.com/MrRio/vtop) uses it to draw CPU and memory usage charts in the terminal
- [`datop`](https://github.com/maxogden/datop) uses it to draw [dat](https://github.com/maxogden/dat) statistics
- [`boscillate`](https://www.npmjs.org/package/boscillate) uses it to draw [`baudio`](https://github.com/substack/baudio) soundwaves in real-time

## license

MIT

  [unicode braille]: http://en.wikipedia.org/wiki/Braille_Patterns#Chart

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