im currently migrating some Frontend implementation into backend, so in frontend im able to use:
const myFile = require('../random.json');
const aux = new File (
[myFile],
"name.json",
{type: "application/json"}
);
const myObject = { myKey: aux }
I'm trying to do the same in nodejs app,
but I'm not able to use File, so it seems that I need to use:
const fs = require('fs');
reading the documentation maybe in my confusion I couldn't find any method to accomplish the same behavior implemented previously used in a frontend application
so, how can I achieve this? do something similar to create a new file, and this instance assign as a value of a key in my current object (example above)
thank you in advance!