title: How to get data from txt file on typescript?
body: <p><a href="https://i.stack.imgur.com/K9UMZ.png" rel="nofollow noreferrer">enter image description here</a>
  <div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>showFile() {
      var fs = require('fs');
      var obj = fs.readFile('dic.txt', 'utf8');
      console.log(obj);
    }
  
    getItems(ev) {
      // Reset items back to all of the items
      this.initializeItems();
  
      // set val to the value of the ev target
      var val = ev.target.value;
  
      // if the value is an empty string don't filter the items
      if (val &amp;&amp; val.trim() != '') {
        this.items = this.items.filter((item) =&gt; {
          this.showFile();
          return (item.toLowerCase().indexOf(val.toLowerCase()) &gt; -1);
        })
      }
    }</code></pre>
  </div>
  </div>
  </p>
  
  <p>I want to make a mobile application as a dictionary. I have a text file that store all the words in Russian with a translation in English. I need to make a search from this file, when to enter words and need to show the translation. I am writing code on Ionic 3. 
  I have error: fs.readFile is not a function.(In 'fs.readFile('dic.txt','utf8')','fs.readFile' is undefined)</p>