forwardemail / font-awesome-assets

:lipstick: Convert any of @FortAwesome's Font-Awesome icons to an asset, such as an <svg> tag or a Base64-encoded PNG/SVG <img> tag! It supports Retina devices and custom tag attributes too!
https://lad.js.org
MIT License
130 stars 18 forks source link

Consider adding a cli tool #2

Closed wmartins closed 4 years ago

wmartins commented 7 years ago

Hey guys, first of all, this project is really nice, it is fitting all my needs by now.

I was just wondering, it would be really nice if I could use this project via a cli tool. For example:

font-awesome-assets svg home 128 "#000" > home.svg

(or something like that)

So, every time I need to create (or even recreate, due to new version) an icon, I wouldn't need to code any javascript.

Also, I think I would be able to add your project in my package.json and just add an npm script to encapsulate that cli, and just use like this:

npm run gen:icon svg home 128 "#000" > home.svg

What do you think about that?

vutran commented 7 years ago

I love this idea. This could live in a separate CLI module and may actually work better with a shorter bin name like fa or faa.

Ideally, we should be setting those parameters via flags since it would be difficult for a user to remember the exact order of the options...

$ faa home

$ faa home --color "#000" > home.svg

$ faa home --size 128 > home.svg

$ faa home --type svg > home.svg

$ faa home --type png > home.png
niftylettuce commented 7 years ago

Just submit a pull request and use crocodile CLI for inspiration at https://github.com/crocodilejs/crocodile-cli

niftylettuce commented 7 years ago

Anyone interested in adding this as a PR? @wmartins @vutran

niftylettuce commented 4 years ago

PR welcome