2.0.2 • Published 5 years ago

broccoli-thumbnail v2.0.2

Weekly downloads
2
License
MIT
Repository
github
Last release
5 years ago

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

OptionTypeDefaultsDescription
prefixStringthumbnail_Prefix to be added on each thumbnail name
extensionsArray['jpg', 'jpeg', 'gif', 'png']Files to be processed
persistBooleanfalseUse disk cache
widthNumber64Thumbnail 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