Conveniently produce authorized imgflo URLs
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
bin
spec
src
.gitignore
.npmignore
.travis.yml
CHANGES.md
LICENSE
README.md
package.json

README.md

imgflo-url Build Status

Conveniently produce authorized imgflo URLs.

Installing

Compatible with node.js and browserify.

npm install --save imgflo-url

Creating a imgflo URL using API

Example in CoffeeScript

imgflo = require 'imgflo-url'

config =
  server: 'https://imgflo.herokuapp.com/'
  key: 'key'
  secret: 'secret'

params =
  input: 'https://pbs.twimg.com/media/BlM0d2-CcAAT9ic.jpg:large'
  color1: '#0A2A2F'
  color2: '#FDE7A0'
  height: 200
url = imgflo config, 'gradientmap', params

Making a GET request of url will fetch image from input URL and process it through the gradientmap graph, applying the specified parameters (in this case color1, color2, height).

For more examples, see the tests.

Create an imgflo URL using commandline

export IMGFLO_API_KEY=key
export IMGFLO_API_SECRET=secret

# if node modules are not on PATH already
# PATH=${PATH}:./node_modules/.bin
imgflo-url passthrough --input http://example.com/barbaz.png --width 300

Running tests

Run npm test.