Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/yusufshakeel/yacui
This is a Node.js project to create user interface for the console.
https://github.com/yusufshakeel/yacui
Last synced: 3 months ago
JSON representation
This is a Node.js project to create user interface for the console.
- Host: GitHub
- URL: https://github.com/yusufshakeel/yacui
- Owner: yusufshakeel
- License: mit
- Created: 2024-06-13T14:50:19.000Z (7 months ago)
- Default Branch: main
- Last Pushed: 2024-06-16T12:00:54.000Z (7 months ago)
- Last Synced: 2024-09-20T14:10:42.054Z (4 months ago)
- Language: TypeScript
- Size: 800 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# yacui (yet another console ui)
This is a Node.js project to create user interface for the console.[![license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/yusufshakeel/yacui)
[![npm version](https://img.shields.io/badge/npm-0.1.11-blue.svg)](https://www.npmjs.com/package/yacui)
[![npm Downloads](https://img.shields.io/npm/dm/yacui.svg)](https://www.npmjs.com/package/yacui)## Table of content
- [yacui (yet another console ui)](#yacui-yet-another-console-ui)
- [Table of content](#table-of-content)
- [Getting started](#getting-started)
- [Require](#require)
- [Components](#components)
- [Window](#window)
- [Modal](#modal)
- [License](#license)
- [Donate](#donate)## Getting started
```shell
npm i yacui
```## Require
```js
// ESM
import { Modal } from 'yacui';// CommonJs
const { Modal } = require('yacui');
```## Components
### Window
```js
import { Window } from 'yacui';const window = new Window()
.withTitle('My title')
.withFooter({ items: ['[F10] Quit'] })
.withWidth(50)
.withHeight(10)
.build();
```When we print the modal we will get the following.
```txt
╔════════════════════════════════════════════════╗
║ My title ║
╠════════════════════════════════════════════════╣
║ ║
║ ║
║ ║
║ ║
╠════════════════════════════════════════════════╣
║ [F10] Quit ║
╚════════════════════════════════════════════════╝
```### Modal
```js
import { Modal } from 'yacui';const modal = new Modal()
.withTitle('My title')
.withBody('This is a sample body for testing and it is occupying multiple lines.')
.withYesButton()
.withNoButton()
.withOkayButton()
.withCloseButton()
.build();
```When we print the modal we will get the following.
```txt
┌─────────────────────────────────┐
│ My title │░
├─────────────────────────────────┤░
│ This is a sample body for │░
│ testing and it is occupying │░
│ multiple lines. │░
│ │░
├─────────────────────────────────┤░
│ [Y]es [N]o [O]kay [C]lose │░
└─────────────────────────────────┘░
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
```## License
It's free :smiley:
[MIT License](https://github.com/yusufshakeel/yacui/blob/main/LICENSE) Copyright (c) 2024 Yusuf Shakeel
## Donate
Feeling generous :smiley: [Donate via PayPal](https://www.paypal.me/yusufshakeel)