0.0.2 • Published 6 years ago
cindery v0.0.2
Cindery
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
Name | Type | Description |
---|---|---|
host | string | The Liquifire url and first path variable that prefixes every image. e.g. http://example.liquifire.com/example |
json | object | An object consisting of keys and values that should match the second element of a map array element. |
map | array | An array of array's, each element in the array consists of a Liquifire url param and it's matching JSON key |
options | object | An object consisting of the Liquifire urls call=url , scale=size , and &sink=format params |
License
MIT © Joshua Kendall