0

How can I get file informations from an .msi file like the comment?

I don't seem to get them via fs module fs.stats.

lifeisfoo
  • 15,478
  • 6
  • 74
  • 115
sirzento
  • 537
  • 1
  • 5
  • 23

1 Answers1

2

To read windows files metadata you can use the get-file-properties package that is a wrapper around the wmic command.

From the doc:

import { getFileProperties, WmicDataObject } from 'get-file-properties'

async function demo() {
  // Ensure you are using double backslashes in your file path
  const filepath: string = 'C:\\path\\to-my\\file.txt'
  let metadata: WmicDataObject

  metadata = await getFileProperties(filepath)
  console.log(metadata.FileSize)
}
lifeisfoo
  • 15,478
  • 6
  • 74
  • 115