mattburns / exiftool.js

A pure javascript implementation of exiftool
MIT License
64 stars 13 forks source link

DeprecationWarning: Calling an asynchronous function without callback is deprecated. #24

Closed vsimko closed 6 years ago

vsimko commented 6 years ago

The warning appears when calling getExifFromLocalFileUsingNodeFs

async function extractExif(path) {
  return new Promise((resolve, reject) => {
    exiftool.getExifFromLocalFileUsingNodeFs(fs, path, (error, exif) => {
      error
        ? reject(error)
        : resolve(exif)
    });
  })
DeprecationWarning: Calling an asynchronous function without callback is deprecated.
    at makeCallback (fs.js:106:12)
    at Object.fs.close (fs.js:545:20)
    at .../node_modules/exiftool.js/exiftool.js:706:24
    at FSReqWrap.wrapper [as oncomplete] (fs.js:629:17)

The warning dissappears when using: fs.close(fd, () => {})