Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lk-geimfari/nebula
Small library for colored (ANSI) output in Erlang/Elixir/LFE. It's can be useful when you need to create user-friendly command-line applications.
https://github.com/lk-geimfari/nebula
ansi beam cli colored colors elixir erlang lfe output
Last synced: about 2 months ago
JSON representation
Small library for colored (ANSI) output in Erlang/Elixir/LFE. It's can be useful when you need to create user-friendly command-line applications.
- Host: GitHub
- URL: https://github.com/lk-geimfari/nebula
- Owner: lk-geimfari
- License: bsd-3-clause
- Archived: true
- Created: 2016-08-24T13:06:35.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2021-04-30T07:23:05.000Z (over 3 years ago)
- Last Synced: 2024-03-14T17:32:03.946Z (8 months ago)
- Topics: ansi, beam, cli, colored, colors, elixir, erlang, lfe, output
- Language: Erlang
- Homepage:
- Size: 2.33 MB
- Stars: 53
- Watchers: 5
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# Nebula
[![test](https://github.com/lk-geimfari/nebula/actions/workflows/ci.yml/badge.svg)](https://github.com/lk-geimfari/nebula/actions/workflows/ci.yml)
[![BSD](https://img.shields.io/pypi/l/Django.svg?maxAge=2592000)](https://github.com/lk-geimfari/nebula/blob/master/LICENSE)
[__Nebula__](https://hex.pm/packages/nebula) is a small library for colored ([ANSI](https://en.wikipedia.org/wiki/ANSI_escape_code#Colors)) output in Erlang/Elixir. It's can be useful when you need to create user-friendly command-line application.
### Installation
Just add `{nebula, "0.1.1"}` to your rebar.config file and run following command:
```
➜ ~ make compile
```or if you want to use this package with `Elixir` add `{:nebula, "~> 0.1.1"}` to your `mix.exs` and run following command:
```
➜ ~ mix deps.get
```### Usage
Using with Erlang:
```erlang
update_something() ->
%% ...
%% ...
nebula:print(green, "Something has been updated successfully!").
```Using with LFE (Lisp Flavoured Erlang):
```lfe
(defun update_something ()
(nebula:print :GREEN "Something has been updated successfully!"))
```Using with Elixir:
```elixir
def update_something do
# ...
# ...
:nebula.print(:green, "Something has been updated successfully!")
end
```### Available functions and colors
First argument is color name (`atom`), second - your message.
- `print/2`: `black`, `red`, `green`, `orange`, `blue`, `purple`, `yellow`, `cyan`, `grey`.
- `background/2`: `black`, `red`, `green`, `yellow`, `blue`, `purple`, `cyan`.### License
BSD 3-Clause License