Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kamiazya/ink-highlight
Highlight component for Ink 🌈
https://github.com/kamiazya/ink-highlight
cli color highlight ink ink-component react syntax-highlighting terminal
Last synced: 3 months ago
JSON representation
Highlight component for Ink 🌈
- Host: GitHub
- URL: https://github.com/kamiazya/ink-highlight
- Owner: kamiazya
- License: mit
- Created: 2020-03-08T07:25:39.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2023-01-08T14:33:19.000Z (almost 2 years ago)
- Last Synced: 2024-09-28T03:21:07.147Z (3 months ago)
- Topics: cli, color, highlight, ink, ink-component, react, syntax-highlighting, terminal
- Language: TypeScript
- Homepage: https://www.npmjs.com/package/ink-highlight
- Size: 527 KB
- Stars: 7
- Watchers: 3
- Forks: 1
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[![GitHub Action](https://github.com/kamiazya/ink-highlight/workflows/NodeCI/badge.svg)](https://github.com/kamiazya/ink-highlight/actions?workflow=NodeCI) [![npm version](https://badge.fury.io/js/ink-highlight.svg)](https://badge.fury.io/js/ink-highlight) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) [![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier) [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](http://makeapullrequest.com)
# ink-highlight
Highlight component for Ink.
Uses ink-highlight for the code syntax highlight on your cli application.## Installation
The plugin can then be installed using [npm](https://www.npmjs.com/):
[![NPM](https://nodei.co/npm/ink-highlight.png)](https://nodei.co/npm/ink-highlight/)
```bash
# yarn
yarn add ink-highlight
# or npm
npm install ink-highlight
```## Usage
```tsx
import React from 'react';
import { render } from 'ink';
import { Highlight } from 'ink-highlight';const code = `SELECT
\`id\`,
\`name\`
FROM \`users\`
WHERE
\`id\` = 1;
`;render();
```## API
### Highlight Component
- **Props**
```ts
type Props = {
code: string;
language?: string;
};
```## License
This software is released under the MIT License, see [LICENSE](./LICENSE).