Rishikant181 / Rettiwt-API

A CLI tool and an API for fetching data from Twitter for free!
https://rishikant181.github.io/Rettiwt-API/
MIT License
486 stars 46 forks source link

CloudFlare Worker Support #572

Open milan-miljus-codetribe opened 4 months ago

milan-miljus-codetribe commented 4 months ago

Hello everyone, I've tried deploying the lib to CloudFlare Workers environment and I've encountered some issues because this environment doesn't have full support of NodeJS APIs that the Rettiwt-API relies one.

Some of this Node APIs are: http, https, querystring, fs, net, tls, assert

Are there plans to support JavaScript runtimes other than node?

Rishikant181 commented 4 months ago

I've tested the library on Bun, where everything works. So you might give it a shot.

milan-miljus-codetribe commented 4 months ago

Glad that it works on Bun, and nice work on the lib btw, I really like it!

But unfortunately this doesn't solve my problem -- CloudFlare Worker is JavaScript runtime itself, and I can't deploy my own runtime, neither nodejs nor Bun, and I have no choice in the architecture here...

Here's the list of nodejs apis supported by CF Workers, as you can see the ones I've mentioned are not officially supported.

There is a trend in the world of npm packages of supporting different runtimes, including CF Workers (some of those are hono, drizzleOrm...) so I was hoping that there may be similar initiative here, but I understand if this is not on the priority list at all.

Would you be interested if somebody submitted a PR which avoids the use of these APIs (at least for certain environments)? This might bring more value in the lib as it increases its usability over different/growing JS runtimes?

Rishikant181 commented 4 months ago

In that case, I'll have to add support for Cloudflare Worker runtime. I'll keep the issue open till it has been added.

Thanks for the feedback!