Skip to content

Instantly share code, notes, and snippets.

@Meandmybadself
Created August 29, 2018 16:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Meandmybadself/88ac323680d64f359f10666c02baeb11 to your computer and use it in GitHub Desktop.
Save Meandmybadself/88ac323680d64f359f10666c02baeb11 to your computer and use it in GitHub Desktop.
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