2.0.5 • Published 4 years ago

imagentz v2.0.5

Weekly downloads
1
License
ISC
Repository
github
Last release
4 years ago

Imagentz Build Status

Image manipulation using sharp

Features:

  • image dynamic caching
  • image manipulation using sharp
  • promisified methods
  • S3 support
  • Redis support

Getting started

...

Usage

const NOTFOUND_DEFAULT_IMAGE = "notfound.jpg";
const TEST_IMAGE = "test.jpg";
const OUTPUT_DIR = "cache";

const types = new Imagentz({
  output_dir: OUTPUT_DIR,
  fallback: NOTFOUND_DEFAULT_IMAGE
})
  .resource(TEST_IMAGE)

  .useRedis("my-prefix", {
    host: "127.0.0.1",
    port: "6379"
  })

  .useS3({
    accessKeyId: "xxxx",
    secretAccessKey: "xxxx",
    region: "xxxx",
    bucket: "xxxx",
    cdn: "http...."
  })

  .addManipulator(manipulator =>
    manipulator
      .key("thumb")
      .quality(90)
      .useWEBP()
      .formatOptions({
        force: true
      })
      .resize({
        width: 100,
        height: 100,
        fit: "cover", //sharp.fit.cover
        position: 16 //sharp.strategy.entropy
      })
  )
  .addManipulator(manipulator =>
    manipulator
      .key("scale")
      .quality(90)
      .useWEBP()
      .formatOptions({
        force: true
      })
      .resize({
        width: 500
      })
  )
  .addManipulator(manipulator =>
    manipulator
      .key("poster")
      .quality(90)
      .useWEBP()
      .resize({
        width: 1920
      })
  )
  .output();

Methods

...

Express middlewares

...

License

...

2.0.5

4 years ago

2.0.3

4 years ago

2.0.4

4 years ago

2.0.2

4 years ago

2.0.1

4 years ago

2.0.0

4 years ago

1.3.6

4 years ago

1.3.5

4 years ago

1.3.4

4 years ago

1.3.3

5 years ago

1.3.2

5 years ago

1.3.1

5 years ago

1.2.1

5 years ago

1.1.1

5 years ago

1.1.0

5 years ago

1.0.0

5 years ago