Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Provides resolution for all images in a given directory.
const sizeOf = require('image-size')
const glob = require('glob')
glob('*.*', {nodir: true, cwd: './i/'}, (err, files) => {
files.forEach(f => {
const dims = sizeOf(`./i/${f}`)
console.log(`${f}\t${dims.width}\t${dims.height}`)
})
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment