title: Ionic | TypeError | fs.createWriteStream is not a function
body: <p>I am trying to create a sample excel file but i am getting error 'fs.createWriteStream is not a function'.
  below is code to create the file-</p>
  
  <pre><code>import { Component } from '@angular/core';
  import { NavController, Platform } from 'ionic-angular';
  import * as Excel from "exceljs/dist/exceljs.js";
  
  @Component({
    selector: 'page-home',
    templateUrl: 'home.html'
  })
  export class HomePage {
  
    constructor(platform: Platform) {
      platform.ready().then(() =&gt; {
        this.createSheetUsingExcelJs();
      });
    }
  
    ionViewDidLoad() {
    }
  
    createSheetUsingExcelJs() {
      let workbook = new Excel.Workbook();
      var worksheet = workbook.addWorksheet('My Sheet');
  
      worksheet.columns = [
        { header: 'Id', key: 'id', width: 10 },
        { header: 'Name', key: 'name', width: 32 },
        { header: 'D.O.B.', key: 'DOB', width: 10 }
      ];
      worksheet.addRow({ id: 1, name: 'Ionic Android', dob: new Date(1970, 1, 1) });
      worksheet.addRow({ id: 2, name: 'Ionic iOS', dob: new Date(1965, 1, 7) });
      var tempFilePath = 'C:/Users/mahmad/Downloads/temp.xlsx';
      console.log(workbook);
  
      workbook.xlsx.writeFile('temp.xlsx').then(function () {
        console.log('file is written');
      });
    }
  }
  </code></pre>
  
  <p>Please suggest a solution to resolve this issue</p>