I’m trying to use the npm package imapflow flow in Ionic. But it require’s ‘net’, ‘tls’, ‘zlib’ and other packages that don’t seem to be included.
Has anyone been able to get them working in Ionic?
Hi, imapflow
seems to be a library for NodeJS runtime, but the end product of Ionic is a frontend SPA client which runs in a browser. To use imapflow
you should setup a Node.js server. You can create a rest api using express
or a similar library to send data from your app to the server.
Thanks.
Apologies for not clarifying the question.
Are there ways to use these nodejs modules in Ionic apps?
Polyfills that map the net library to whatever the ionic way of creating a socket is, etc.?
It seems like this functionality would be something a mobile app would be able to support.
No. There is no way to run NodeJS modules from Ionic apps. Ionic apps run frontend code only with capacitor/cordova plugins to access native mobile apis. NodeJS typically runs on a backend server, not on mobile devices.