1.0.0 • Published 9 years ago

embedly-view-helpers v1.0.0

Weekly downloads
1
License
MIT
Repository
github
Last release
9 years ago

Embedly View Helpers

A library of view helper functions to leverage Embedly for on-the-fly image processing.

Example

On the server with Express and Jade

var app = express();

app.locals.crop = require('embedly-view-helpers')(EMBEDLY_KEY).crop;
body
  h1
    img( src=crop(img.url, { width: 400, height: 400, quality: 90 }) )

Or on the client with Browserify

var crop = require('embedly-view-helpers')(EMBEDLY_KEY).crop;

$('img').attr('src', crop(//...))

Contributing

Please fork the project and submit a pull request with tests. Install node modules npm install and run tests with npm test. You can look at the example by passing your Embedly key a an env variable EMBEDLY_KEY=X npm run example.

License

MIT