Code Monkey home page Code Monkey logo

frmt's Introduction

About

frmt is a CLI format convertor for those who live in the terminal.

It was built for my own convenience and thought it'd be cool to turn this into a tool that anyone can use. Go was the first choice due to the ease of making CLI tools with the language.

Pronounced as format.

Frmt working ss

Installation

1. Install with Go

go install github.com/Shobhit-Nagpal/frmt@latest

2. Install from Homebrew

Tap the repo

brew tap Shobhit-Nagpal/frmt

Install frmt

brew install frmt
  • To check the directory where frmt is installed:
which frmt

3. Install manually

Clone repo

git clone [email protected]:Shobhit-Nagpal/frmt.git

Move binary to /bin directory

sudo mv frmt /bin/
  • Once the binary file has been moved to /bin/ directory, you can start using frmt as you'd like :)

Uninstallation

1. With Homebrew

brew uninstall frmt

2. Manually

To remove the binary from your bin directory:

which frmt
sudo rm $(which frmt) 

Usage

To convert your file into another format, execute the following command:

frmt -p <FILE_PATH> -f <DESIRED_FORMAT>
  • Converted file is created in your present working directory (aka where you executed the command)

  • File paths can be relative and/or absolute

  • Format flag is case insensitive

  • For information on flags, run

frmt -h

Supported output formats

  • PNG
  • JPG / JPEG
  • BMP
  • PDF
  • TIF / TIFF

Working

The way frmt works is pretty simple.

  • First, it takes your file path and desired format as arguments/flags
  • It converts the file path to an absolute path and then checks if the file exists
  • If the file exists, it checks if the file is already present in the desired format
  • If the file is not in its desired format, it creates a new file which is the converted format of the original file
  • Error handling is done at each stage

To add:

  • Give pdf as input and convert to desired format

frmt's People

Contributors

shobhit-nagpal 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.