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

183
Views
Estoy obteniendo códigos de búfer y hexadecimales
var fs = require('fs'); fs.readFile('TestFile.txt', function (err, data) { if (err) throw err; console.log(data); });

//TestFile.txt This is test file to test fs module of Node.js

  1. Estoy obteniendo códigos hexadecimales y de búfer en lugar de datos de la consola
  2. <Búfer 54 68 69 73 20 69 73 20 74 65 73 74 20 66 69 6c 65 20 74 6f 20 74 65 73 74 20 66 73 20 6d 6f 64 75 6c 65 20 6f 66 20 3 4e 6 5f>
about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

Según la documentación :

Si no se especifica codificación (mediante options.encoding), los datos se devuelven como un objeto <Buffer> . De lo contrario, los datos serán una cadena.

Solución: agregue una codificación (¡y lea el documento! :)

 fs.readFile('TestFile.txt', { encoding : 'utf8' } , function()...
about 4 years ago · Juan Pablo Isaza Report

0

Al convertir datos a String (datos) obtendrá texto

about 4 years ago · Juan Pablo Isaza Report
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!