Sharp: Batch processing? Globs?

Created on 30 Apr 2018  路  2Comments  路  Source: lovell/sharp

Can someone point me to an example that processes an image folder instead of a single image? Thanks.

question

Most helpful comment

Hello, perhaps use the glob module to build a list of files.

glob("*.jpg", (err, files) => {
  for (const file of files) {
    sharp(file)...
  }
});

All 2 comments

Hello, perhaps use the glob module to build a list of files.

glob("*.jpg", (err, files) => {
  for (const file of files) {
    sharp(file)...
  }
});

Hope this answered your question.

Was this page helpful?
0 / 5 - 0 ratings