Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

imagecachejs

Package Overview
Dependencies
Maintainers
3
Versions
29
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

imagecachejs

Imagecache is a express middleware that lets you manipulate images and then cache them for quick retrieval.

  • 0.0.8
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2
decreased by-33.33%
Maintainers
3
Weekly downloads
 
Created
Source

imagecache.js

Imagecache is a express middleware that lets you manipulate images and then cache them for quick retrieval.

Installation

Install with npm or yarn:

npm install --save imagecachejs

Usage

It's easy to just add imagecache to your application

import path from 'path'
import express from 'express'
import imagecache from 'imagecachejs'

const app = express()

app.use(express.static('./public'))

app.use('/imagecache', imagecache({
  destination: path.resolve('cached'),
  sources: [
    'http://localhost:8080'
  ]
}))

app.listen(8080, function () {
  console.log('Example app listening on port 8080')
})

Brightness

Increase or decrease the brightness

http://localhost:3000/imagecache/images/kitten.jpg?bri=50
http://localhost:3000/imagecache/images/kitten.jpg?bri=-50

Contrast

Increase or decrease the brightness

http://localhost:3000/imagecache/images/kitten.jpg?con=50
http://localhost:3000/imagecache/images/kitten.jpg?con=-50

Flip

Flip the image horizontally, vertically, or both

http://localhost:3000/imagecache/images/kitten.jpg?flip=h
http://localhost:3000/imagecache/images/kitten.jpg?flip=v
http://localhost:3000/imagecache/images/kitten.jpg?flip=vh

Colorize

Colorize image with a preset

http://localhost:3000/imagecache/images/kitten.jpg?col=greyscale
http://localhost:3000/imagecache/images/kitten.jpg?col=sepia

Blur

Blur image with a radius

http://localhost:3000/imagecache/images/kitten.jpg?blur=15

Rotate

Rotate image and then crop to largest possible rectangle with same aspect ratio

http://localhost:3000/imagecache/images/kitten.jpg?rot=45

Crop

Crop the image using a reactangle in the format "x,y,w,h"

http://localhost:3000/imagecache/images/kitten.jpg?crop=100,100,400,200

Resize

Resize the image

http://localhost:3000/imagecache/images/kitten.jpg?w=500

http://localhost:3000/imagecache/images/kitten.jpg?w=200&dpi=2

http://localhost:3000/imagecache/images/kitten.jpg?h=250

http://localhost:3000/imagecache/images/kitten.jpg?w=300&h=300

FAQs

Package last updated on 24 May 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc