Accessing File from Function / Deployment

I found another post with a similar issue:

I’ve tried to imitate the solution by requiring it but it returns an empty object.

const pdfFile = require(“./test.pdf”);
console.log(pdfFile); //{}