Giter Site home page Giter Site logo

elix_io_color's Introduction

IO Color

Wrapping your IO.inspect and IO.puts in vibrant colors since 2018.

No external dependencies.

Installation

Add {:io_color, "~> 0.2.0"} to your dependencies.

def deps do
  [
    {:io_color, "~> 0.2.0"}
  ]
end

Usage

list = [
	%{"name" => "Vincent", age: 18},
	%{"name" => "Teemo", age: 21},
	%{"name" => "Clara", age: 23}
]

IOC.inspect(list, "Optional Label")

What it looks like:

What your current IO.inspect looks like:

Wait, IOC.insp?

All of these will work, choose whichever you like!

IOC.insp(list, "something")
IOC.inspect(list, "something")
IOColor.insp(list, "something")
IOColored.insp(list, "something")
IOColor.inspect(list, "something")
IOColored.inspect(list, "something")

# `IO.puts`: accepts one arg only
IOC.puts("Some string")
IOColor.puts("Some string")
IOColored.puts("Some string")

Will my |>s still work?

Of course!

conn
|> Map.get(:body_params)
|> IOC.insp("Incoming Body Params")
|> process_body_params
|> IOC.insp("Process result")
|> case do
      # ...
   end
Custom colors / other commands?

I'm currently putting this here for my personal convenience. Yeah I'm lazy to copy a single module file across all my projects, I know. But if it'll be useful to you to see more features, feel free to put in an issue and pull request, and I'll help what I can. Just saying, it seems that supporting presets (soft or hard) may be better than just custom colors, because the colour combinations are hard to get right.

Contributing

# install erlang, elixir

git clone https://github.com/Seiyial/elix_io_color.git
cd io_color
iex -S mix run

elix_io_color's People

Contributors

seiyial avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.