Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

169
Vistas
assign File into object property node js

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!

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda