Skip to content

joshmarinacci/node-pureimage-cache

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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)
})

About

image cache built on Node PureImage

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published