I have a question, how would it look for a directory so that it would be for the default path, as it would look for inside a folder eg .PDF FILES? const filePath = event.data.name; const fileDir = path.dirname(filePath); const newName = path.basename(filePath, '.pdf') + '.png';