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 (about 5 years ago)
- Default Branch: main
- Last Pushed: 2023-01-08T14:33:19.000Z (over 2 years ago)
- Last Synced: 2024-09-28T03:21:07.147Z (8 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
[](https://github.com/kamiazya/ink-highlight/actions?workflow=NodeCI) [](https://badge.fury.io/js/ink-highlight) [](https://opensource.org/licenses/MIT) [](https://github.com/prettier/prettier) [](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/):
[](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).