pureimage-cache

0.0.6 • Public • Published

node-pureimage-cache

Image Thumbnail cache built on PureImage. It scales down images Typically it would be used inside of a web-server application. Create an instance of the

 
const paths = require('path')
const ImageCache = require('../index.js')
const cache = new ImageCache({
    cacheDir:paths.join(__dirname,"thumbnails"), //absolute path of the dir to store thumbnails
    useWorkers:false, //use a background process to do the scaling
})
 
cache.makeThumbnail({
    width:100,  //desired width
    path: paths.join(__dirname,'bizcard.png'),  //absolute path on disk of the original image
    name: 'bizcard', //name used to generate the cached file on disk
    extension: ImageCache.PNG,
}).then(thumbPath =>{
    console.log("generated a thumbnail on disk at", thumbPath)
})
 

Readme

Keywords

none

Package Sidebar

Install

npm i pureimage-cache

Weekly Downloads

6

Version

0.0.6

License

ISC

Unpacked Size

64 kB

Total Files

15

Last publish

Collaborators

  • joshmarinacci