title: What to use instead of Buffer(bitmap)
body: <p>I'm using the following method to convert files into base64 encoding and it's been working fine for a long time, but I see now that Buffer is depricated.</p>
  <pre><code>        // function to encode file data to base64 encoded string
          function base64_encode(file) {
          
              var bitmap = fs.readFileSync(file);
              // convert binary data to base64 encoded string
              return new Buffer(bitmap).toString(&quot;base64&quot;);
          }
          let base64String = base64_encode(&quot;Document.png&quot;);
  </code></pre>
  <p>Can someone please help me modify this to work with the new suggested method as I'm not sure how to modify it myself?</p>
  <p>Thank you so much in advance.</p>