iTzSharkSV / Presentio

Present CLI Info in Style! (A CLI app helper)

Home Page:https://npm.im/presentio

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Presentio

Present CLI Info in Style! (A CLI app helper)

CircleCI Codecov npm bundle size

Buy Me A Coffee


The Why?

Why use Presentio instead of console.log()?
-------------------------------------------
Simply put it, its way more:
  - Elegent
  - Colorful
  - Readable
  - & Minimal
Why create a whole library for this?
------------------------------------
Presentio is a tool that was originally created for the Hyper Cli;
The use of various libraries to just log some basic colored txt & a help msg was a bit too excessive.
Here aroused the idea to create a fully fletched yet lightwieght library.
& that's how this project was born.

Add as a Dependency

yarn add presentio
# or
npm install presentio

Usage/Examples

Example usage: Hyper

import Present from 'presentio';

Present({
  title: 'Hyper',
  tagline: 'by @Shorky',
  description: 'A CLI to bootstrap new projects!',
  version: '1.0',
  // defaults > fg: 'black', bg: 'green', clear: true
}, helpMessage);
     // ^ Msg to print upon use of help argument (ig* -h, --help)

Presentio also includes a built-in fn to ease the process of creating a help message.

import Present, { helpTxt } from 'presentio';

const cliCmds = {
  commands: {
    prettify: 'add rainbows everywhere'
  },
  flags: {
    rainbow: {
      alais: 'r',
      description: 'girl-in-red?',
      default: false
    }
  }
}

Present({
  ... // same config as above
}, helpTxt(cliCmds));

Expected output from: $ hyper -h/--help

Hyper v1.0 by @Shorky
A CLI to bootstrap new projects!

Usage:
  $ hyper <commands> [options]

Commands:
  <!-- cmd: description -->
  prettify: add rainbows everywhere

Options:
  <!-- alias, flag: description -->
  -r, --rainbow: girl-in-red?
  -h, --help: Print CLI's helpTxt      <!-- Included by default -->
  -v, --version: Print CLI's version   <!-- Included by default -->

Available Clrs (for fg&bg)

<!-- Incase sensitive -->
- Black
- Red
- Green
- Yellow
- Blue
- Magenta
- Cyan
- White
<!-- We'll be adding more later -->

Project Tree (For contributors)

πŸ“¦ <Presentio>
β”œβ”€ .circleci
β”‚  β””─ config.yml
β”œβ”€ .github
β”‚  β”œβ”€ ISSUE_TEMPLATE
β”‚  β”‚  β”œβ”€ BUG_REPORT.md
β”‚  β”‚  β””─ FEATURE_REQUEST.md
β”‚  β”œβ”€ workflows
β”‚  β”‚  β”œβ”€ CodeQL.yml
β”‚  β”‚  β””─ Release.yml
β”‚  β””─ PULL_REQUEST_TEMPLATE.md
β”œβ”€ .husky
β”‚  β””─ pre-commit
β”œβ”€ Lib
β”‚  β”œβ”€ @Types
β”‚  β”‚  β”œβ”€ Args.d.ts
β”‚  β”‚  β”œβ”€ Present.d.ts
β”‚  β”‚  β””─ Usage.d.ts
β”‚  β”œβ”€ Modules
β”‚  β”‚  β”œβ”€ Clear.ts
β”‚  β”‚  β””─ Clrs.ts
β”‚  β”œβ”€ Utils
β”‚  β”‚  β”œβ”€ ErrorHandler.ts
β”‚  β”‚  β””─ Indent.ts
β”‚  β”œβ”€ Args.ts
β”‚  β”œβ”€ Present.ts
β”‚  β””─ Usage.ts
β”œβ”€ __Tests__
β”‚  β””─ <!-- Same as @Lib -->
β”œβ”€ .gitignore
β”œβ”€ .prettierrc    <!-- Available within package.json -->
β”œβ”€ .eslintrc      <!-- Available within package.json -->
β”œβ”€ jest.config.ts
β”œβ”€ rollup.config.js
β”œβ”€ README.md
β”œβ”€ package.json
└─ tsconfig.json
Made With β™₯ By @Shorky

License

#
# Copyright 2022 @SharkSV
# License Identifier: MIT
#

About

Present CLI Info in Style! (A CLI app helper)

https://npm.im/presentio

License:MIT License


Languages

Language:TypeScript 94.0%Language:JavaScript 5.4%Language:Shell 0.6%