title: Angular - Getting list of files from local directory
body: <p>I am trying to read a list of files from a local directory using Angular 5-.</p>
  
  <p>However i get the following error:</p>
  
  <blockquote>
    <p>TypeError: fs.readdir is not a function</p>
  </blockquote>
  
  <p>My .ts file is below:</p>
  
  <pre><code>import { Component, OnInit } from '@angular/core';
  import * as fs from 'fs';
  
  @Component({
    selector: 'app-review',
    templateUrl: './review.component.html',
    styleUrls: ['./review.component.css']
  })
  export class ReviewComponent implements OnInit {
  
    constructor() { }
  
  
    ngOnInit() {
  
      var fs = require('fs');
  
      fs.readdir('./assets', function (err, files) {
        // "files" is an Array with files names
              console.log(files);
  
    });
    }
  
  }
  </code></pre>
  
  <p>Note have done npm install fs --save.</p>
  
  <p>Also please help me finding datemodified info of the files.</p>