JSPM

ink-image

2.0.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 333
  • Score
    100M100P100Q91010F
  • License MIT

Image component for Ink

Package Exports

  • ink-image

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (ink-image) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

ink-image Build Status

Image component for Ink

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