@josvar/image-resizer
Image resizer
Last updated a year ago by josvar .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @josvar/image-resizer 
SYNC missed versions from official npm registry.

image-resizer

Latest Version on NPM Software License

Custom Cli for sharp image resizer

Install

You can install the package via yarn:

$ npm i @josvar/image-resizer

Usage

Create config file:

image-resizer init

Edit configuration file.

Resize images:

image-resizer resize -c [./images.config.js] -i [./input] -o [./output] -p [default]

Configuration

module.exports = {
  presets: {
    default: {
      sizes: [600, 400, 200],
      name: '[n]-[w][e]',
      jpeg: {
        quality: 50,
      },
    },
  },
}

Name tokens

  • n : filename without extension
  • b : filename
  • e : extension, eg .jpeg, .png
  • w : width (empty string if no present)
  • h : height (empty string if no present)

Sizes

  • width resize: [300, {w: 600}, 900, {w: 1200}, ...]
  • height resize: [{h: 300}, {h: 600}, ...]
  • aspect ratio resize: [{aspectRatio: '4:3', w: 600}, {aspectRatio: '5:2', w: 900}]

Jpeg Options

  • quality (default 85)
  • progressive (default true)
  • other sharp jpeg params

Changelog

Please see CHANGELOG for more information what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please contact Josue Vargas instead of using the issue tracker.

License

The MIT License (MIT). Please see License File for more information.

Credits

Current Tags

  • 0.3.0                                ...           latest (a year ago)

7 Versions

  • 0.3.0                                ...           a year ago
  • 0.2.0                                ...           a year ago
  • 0.1.5                                ...           a year ago
  • 0.1.4                                ...           2 years ago
  • 0.1.2                                ...           2 years ago
  • 0.1.1                                ...           2 years ago
  • 0.1.0                                ...           2 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 5
Last Day 0
Last Week 0
Last Month 0
Dependencies (6)
Dev Dependencies (8)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |