New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

ink-render-string

Package Overview
Dependencies
Maintainers
2
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ink-render-string

Render string for ink components

latest
Source
npmnpm
Version
1.0.0
Version published
Weekly downloads
5.1K
-30.6%
Maintainers
2
Weekly downloads
 
Created
Source

ink-render-string

ink-render-string provides a render function which will return a string, which is the rendered content of the ink component you pass to the render function.

Install

yarn add ink-render-string

Usage

import { render } from 'ink-render-string';
import { Text } from 'ink';

const Component = () => <Text>Hello World</Text>;

const { output, cleanup } = render(<Component />);
output.includes('Hello World'); //=> true

cleanup(); // cleans up outstanding render resources

The render function also returns a number of other instance properties:

  • output: the rendered output
  • cleanup: a function which cleans up outstanding render resources
  • unmount: a function which unmounts the component
  • stdout: the original stdout
  • stderr: the original stderr
  • exitCode: the original exit code
  • frames: an array of rendered frames

FAQs

Package last updated on 12 Jul 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts