drawille-chalk

1.1.2 • Public • Published

drawille-chalk

drawing in terminal with unicode braille characters and color. The idea is based on drawille by @asciimoo.

NPM version npm npm

rainbow sin-wave

updates

Aril 20 2019 upgrade dependencies to remove deprecation warnings 1.1.1 -> 1.1.2

install

install the package with npm or yarn:

$ npm install --save drawille-chalk

or

$ yarn add drawille-chalk

usage

See examples.

this module provides a very basic API only, for fancy things, like drawing lines, use another module, like bresenham.

node-drawille original project forked from.

api

Canvas(w, h)

Create a new canvas with the given dimensions. w must be multiple of 2, h must be multiple of 4.

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.

canvas.style(canvas.chalk.*)

Adds a formatting function to apply to set points upon rendering.

canvas.styleEnd()

Clear current formatting.

license

MIT

Readme

Keywords

none

Package Sidebar

Install

npm i drawille-chalk

Weekly Downloads

1

Version

1.1.2

License

MIT

Unpacked Size

6.47 kB

Total Files

4

Last publish

Collaborators

  • mazzarelli