Ionic And Node

Im trying to use this node module [musicmetadata] in my ionic app and am facing some issues.

This is my code:

import { createReadStream } from 'fs';
import musicmetadata from 'musicmetadata';

  static getMetadata(music: string, callback?: (err: Error, res: MM.Metadata) => any) {
    musicmetadata(createReadStream(music, { autoClose: true }), (err: Error, metadata: MM.Metadata) => {
      return callback(err, metadata);
    });
  }
}

It gives me a Webpack error, I dont know if the issue is with the module of node fs module.
Please help …

fs does not exist in the browser. This isn’t going to work.

Thanks @rapropos would try this on a device instead

Sorry, but that’s not going to work either. Not every node module is going to work outside of an actual node environment.

So that means it’s impossible to use the musicmetadata module for an android app using ionic

For your sake, I hope I’m wrong, but that is my inclination.