Imgfy url generator cli


Keywords
imgify, create, image, easly, cli, tool
License
ISC
Install
npm install imgfy@2.0.4

Documentation

Installing

npm i -g imgfy

NPM

Usage: imgfy [options]

Options:

-h, --help               output usage information
-o, --open               Open url in browser
-c, --content <content>  Content file dir

 Demo proposal:

content.json's content:

{
  "template": {
    "backgroundImage": "url(http://res.cloudinary.com/cagatayc/image/upload/profile.jpg)",
    "backgroundColor": "#cccccc",
    "backgroundRepeat": "no-repeat"
  },
  "images": [
    {
      "id": 1,
      "src": "http://res.cloudinary.com/cagatayc/image/upload/racoon.png",
      "property": {
        "position": "absolute",
        "top": "152px",
        "left": "122px",
        "maxHeight": "37px"
      }
    },
    {
      "id": 2,
      "src": "http://res.cloudinary.com/cagatayc/image/upload/racoon.png",
      "property": {
        "position": "absolute",
        "top": "141px",
        "left": "210px",
        "maxHeight": "37px"
      }
    }
  ]
}
imgfy -c content.json -o

Output: (My eyes looking with love, Please dont afraid )

imgfy demo image

 Programmatically.

 File system example:

var app = require('./index');

app({file: 'content.json', open: true})
  .then((value) => {
    console.log(value);
  })
  .catch((err) => {
    console.log(err);
  })

 Direct content example:

var app = require('./index');

var content = {
  "template": {
    "backgroundImage": "url(http://res.cloudinary.com/cagatayc/image/upload/profile.jpg)",
    "backgroundColor": "#cccccc",
    "backgroundRepeat": "no-repeat"
  },
  "images": [
    {
      "id": 1,
      "src": "http://res.cloudinary.com/cagatayc/image/upload/racoon.png",
      "property": {
        "position": "absolute",
        "top": "152px",
        "left": "122px",
        "maxHeight": "37px"
      }
    },
    {
      "id": 2,
      "src": "http://res.cloudinary.com/cagatayc/image/upload/racoon.png",
      "property": {
        "position": "absolute",
        "top": "141px",
        "left": "210px",
        "maxHeight": "37px"
      }
    }
  ]
}

app({content: content, file: false, open: true}) // Open in browser.
  .then((value) => {
    console.log(value);
  })
  .catch((err) => {
    console.log(err);
  })

Maintenance & Development Çağatay Çalı

Made with ❤️