1.0.1 • Published 9 years ago

tasvir v1.0.1

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

tasvir

Bulk image manipulation tool

Installation

npm install tasvir -g

Running

Normal mode:

tasvir

Overwrite mode (will force tinification):

tasvir overwrite

Sample configuration file:

tasvir.config.js

module.exports = {
  prefixSeparator: '--',

  tinify: {
    enabled: true,
    apiKey: '<YOUR-KEY>',
    saveOriginal: true,
    originalPrefix: 'orig',
  },

  paths: [
    'static/images/*'
  ],

  rules: [
    {
      chain: [
        { apply: 'resize', params: [ 600, 'AUTO' ] },
        { apply: 'write', prefix: 'w600' }
      ]
    },
    {
      chain: [
        { apply: 'cover', params: [ 300, 300 ] },
        { apply: 'write', prefix: 'sq' }
      ]
    }
  ]
};