• Stars
    star
    162
  • Rank 232,284 (Top 5 %)
  • Language
    JavaScript
  • Created about 8 years ago
  • Updated about 8 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Imgfy, create your html pages easly. ✔️

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 ❤️