2.0.0 • Published 5 years ago

ink-image v2.0.0

Weekly downloads
10
License
MIT
Repository
github
Last release
5 years ago

ink-image Build Status

Image component for Ink

npm.io

Currently only supported on iTerm >=3.

Install

$ npm install ink-image

Usage

import React from 'react';
import {render} from 'ink';
import Image from 'ink-image';

render(
	<Image preserveAspectRatio src='unicorn.jpg' width='50%'/>
);

API

<Image/>

Besides the props below, it accepts props allowed in ansi-escapes.

src

Type: string | Buffer

Path to an image or the image as a Buffer.

alt

Type: string

Alternative text to show when an image can't be displayed.

License

MIT © Kevin Mårtensson