title: How to read file character by character with Node.js
body: <p>I know you can read line-by-line with <code>require('readline')</code>, is there a good way to read a file character by character? Perhaps just use readline and then split the line into characters?</p>
  
  <p>I am trying to convert this code:</p>
  
  <pre><code>const fs = require('fs');
  const lines = String(fs.readFileSync(x));
  
  for(const c of lines){
     // do what I wanna do with the c
  }
  </code></pre>
  
  <p>looking to make this into something like:</p>
  
  <pre><code>fs.createReadStream().pipe(readCharByChar).on('char', c =&gt; {
      // do what I wanna do with the c
  });
  </code></pre>