How would I do require('googleapis') in a worker?

My question is pretty straightforward: How would I do
const { google } = require('googleapis')
const { google } = require('googleapis')
In a worker?
5 Replies
Migmac
MigmacOP15mo ago
Is this even possible within workers?
Cyb3r-Jak3
Cyb3r-Jak315mo ago
Have you installed the googleapis npm package?
Migmac
MigmacOP15mo ago
how would I do that within a worker?
Cyb3r-Jak3
Cyb3r-Jak315mo ago
Where are you editing your worker? If you are using quick edit then you can’t as it doesn’t support importing packages. You need to be using wrangler for it
Migmac
MigmacOP15mo ago
I just now realised that thank you! Using wrangler and it works wonderfully. The quick edit doesn't allow file creation even though they show up in the UI It took me a while to realise that I guess this issue is solved! Thanks
Want results from more Discord servers?
Add your server