Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

167
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!