0.0.2 • Published 6 years ago

cindery v0.0.2

Weekly downloads
3
License
MIT
Repository
github
Last release
6 years ago

Cindery Build Status

Cindery is a JSON to Liquifire mapping library.

Installation

$ npm install --save cindery

or

$ yarn add cindery

Usage

const cindery = require('cindery');

const json = {
  COLOR: 'AWESOME ORANGE',
  MODEL: '25C',
  VIEW: 'F'
};

const map = [
  ['upholstery', 'COLOR'],
  ['id', 'MODEL'],
  ['view', 'VIEW']
];

const options = {
  url: 'file:main.chain.txt',
  size: '600',
  format: 'png'
};

var image = cindery('http://example.liquifire.com/example', json, map, options)

Output

Cindery returns an image url similar to http://example.liquifire.com/example?set=upholstery[AWESOME ORANGE],id[25C],view[F]&call=url[file:main.chain.txt]&scale=size[600]&sink=format[png]

Options

NameTypeDescription
hoststringThe Liquifire url and first path variable that prefixes every image. e.g. http://example.liquifire.com/example
jsonobjectAn object consisting of keys and values that should match the second element of a map array element.
maparrayAn array of array's, each element in the array consists of a Liquifire url param and it's matching JSON key
optionsobjectAn object consisting of the Liquifire urls call=url, scale=size, and &sink=format params

License

MIT © Joshua Kendall