broccoli-thumbnail

2.0.2 • Public • Published

broccoli-thumbnail

Build Status GitHub version NPM version Dependency Status codecov Greenkeeper badge

Information

NPM

Copy and resizes images given an input tree.

Why? For example, to generate a low quality copy of each image and improve the page speed when loading.

Installation & usage

npm install --save broccoli-thumbnail

// Raw
const Thumbnail = require('broccoli-thumbnail');
 
const myTree = new Funnel('assets/images');
const thumbnailTree = new Thumbnail(myTree, {
  width: 128,
  prefix: 'small-'
});
// Ember addon style
const Thumbnail = require('broccoli-thumbnail');
 
module.exports = {
  // ...
 
  treeForPublic() {
    return new Thumbnail('assets/images', { /* options */ });
  }
};

Options

Option Type Defaults Description
prefix String thumbnail_ Prefix to be added on each thumbnail name
extensions Array ['jpg', 'jpeg', 'gif', 'png'] Files to be processed
persist Boolean false Use disk cache
width Number 64 Thumbnail width

Versioning

We use SemVer for versioning. For the versions available, see the tags on this repository.

Authors

See the list of contributors who participated in this project.

License

This project is licensed under the MIT License - see the LICENSE.md file for details

Package Sidebar

Install

npm i broccoli-thumbnail

Weekly Downloads

0

Version

2.0.2

License

MIT

Unpacked Size

155 kB

Total Files

11

Last publish

Collaborators

  • bbvaengineer