Skip to content

Commit

Permalink
docs(cursor): Update documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
ghaiklor committed Dec 24, 2015
1 parent 8f09669 commit d2234a7
Showing 1 changed file with 20 additions and 23 deletions.
43 changes: 20 additions & 23 deletions docs/Cursor.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

## Class: Cursor
By default, creates simple cursor that writes direct to `stdout`.
If you want to work with other streams, you can pass custom `stdout` stream in.
If you want to work with other streams, you can pass custom `stdout` stream in or an array of streams.

### Cursor.write(data)

Expand All @@ -35,19 +35,34 @@ Write from the buffer to stream and clear it up.

**Returns**: `Cursor`

### Cursor.pipe(stream)

Pipe cursor to another stream.
Useful when you want to attach cursor to another stream, response stream, for instance.
It doesn't clear previous streams, just pushes the new one to them.

**Parameters**

**stream**: `Stream`, Pipe cursor to another stream.
Useful when you want to attach cursor to another stream, response stream, for instance.
It doesn't clear previous streams, just pushes the new one to them.

**Returns**: `Cursor`

### Cursor.image(image, width, height, preserveAspectRatio)

Draw an image in terminal.
Supports only by few terminals, as I know only in iTerm 2 (v2.9).

**Parameters**

**image**: `String`, Base64 encoded image contents
**image**: `String`, Base64 encoded image content

**width**: `Number`, Width to render, can be 100 (cells), 100px, 100% or auto
**width**: `Number | String`, Width to render, can be 100 (cells), 100px, 100% or auto

**height**: `Number`, Height to render, can be 100 (cells), 100px, 100% or auto
**height**: `Number | String`, Height to render, can be 100 (cells), 100px, 100% or auto

**preserveAspectRatio**: `Boolean`, If set to 0, the image's aspect ratio will not be respected
**preserveAspectRatio**: `Boolean`, If set to false, the image's aspect ratio will not be respected

**Returns**: `Cursor`

Expand Down Expand Up @@ -298,24 +313,6 @@ Reset all display modes and cursor attributes to default.

**Returns**: `Cursor`

### Cursor.getTTYSize()

Get TTY sizes from stream, if it's possible.

**Returns**: `Object`

### Cursor.getTTYWidth()

Get width of TTY.

**Returns**: `Number`

### Cursor.getTTYHeight()

Get height of TTY.

**Returns**: `Number`

### Cursor.resetTTY()

Reset all terminal settings to default.
Expand Down

0 comments on commit d2234a7

Please sign in to comment.