Cannot use this npm module with Cf worker of type webpack

Generated a new cloudflare worker and changed it to type webpack from javascript and was successfully using quite a few npm packages with it. But for some reason, I am not able to use this particular npm package (twitter-api-v2 - npm Github: GitHub - PLhery/node-twitter-api-v2: Strongly typed, full-featured, light, versatile yet powerful Twitter API v1.1 and v2 client for Node.js.)

I think the reason might be that it is a Typescript based package and it has a developer note stating the following:

Default export is a TypeScript-CommonJS-wrapped default export — it isn’t a regular ECMA module default export

Is there some way as to how I can make this package work (which possibly means running cjs files on the worker)?

The complete log of running the worker (wrangler dev) with the above mentioned package is as follows:

0 info it worked if it ends with ok
1 verbose cli [
1 verbose cli   '/home/marlin/.nvm/versions/node/v12.18.4/bin/node',
1 verbose cli   '/home/marlin/.nvm/versions/node/v12.18.4/bin/npm',
1 verbose cli   'run',
1 verbose cli   'build'
1 verbose cli ]
2 info using [email protected]
3 info using [email protected]
4 verbose run-script [ 'prebuild', 'build', 'postbuild' ]
5 info lifecycle [email protected]~prebuild: [email protected]
6 info lifecycle [email protected]~build: [email protected]
7 verbose lifecycle [email protected]~build: unsafe-perm in lifecycle true
8 verbose lifecycle [email protected]~build: PATH: /home/marlin/.nvm/versions/node/v12.18.4/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/home/marlin/Desktop/cloudflare-workers/my-typescript-worker/node_modules/.bin:/home/marlin/.nvm/versions/node/v12.18.4/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
9 verbose lifecycle [email protected]~build: CWD: /home/marlin/Desktop/cloudflare-workers/my-typescript-worker
10 silly lifecycle [email protected]~build: Args: [ '-c', 'webpack' ]
11 silly lifecycle [email protected]~build: Returned: code: 1  signal: null
12 info lifecycle [email protected]~build: Failed to exec build script
13 verbose stack Error: [email protected] build: `webpack`
13 verbose stack Exit status 1
13 verbose stack     at EventEmitter.<anonymous> (/home/marlin/.nvm/versions/node/v12.18.4/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:332:16)
13 verbose stack     at EventEmitter.emit (events.js:315:20)
13 verbose stack     at ChildProcess.<anonymous> (/home/marlin/.nvm/versions/node/v12.18.4/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack     at ChildProcess.emit (events.js:315:20)
13 verbose stack     at maybeClose (internal/child_process.js:1021:16)
13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5)
14 verbose pkgid [email protected]
15 verbose cwd /home/marlin/Desktop/cloudflare-workers/my-typescript-worker
16 verbose Linux 5.8.0-50-generic
17 verbose argv "/home/marlin/.nvm/versions/node/v12.18.4/bin/node" "/home/marlin/.nvm/versions/node/v12.18.4/bin/npm" "run" "build"
18 verbose node v12.18.4
19 verbose npm  v6.14.6
20 error code ELIFECYCLE
21 error errno 1
22 error [email protected] build: `webpack`
22 error Exit status 1
23 error Failed at the [email protected] build script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]

The error returned while running this as follows:

ERROR in ./node_modules/twitter-api-v2/dist/client-mixins/oauth2.helper.js 23:28-45
Module not found: Error: Can't resolve 'crypto' in '/home/marlin/Desktop/cloudflare-workers/my-typescript-worker/node_modules/twitter-api-v2/dist/client-mixins'

BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
This is no longer the case. Verify if you need this module and configure a polyfill for it.

If you want to include a polyfill, you need to:
        - add a fallback 'resolve.fallback: { "crypto": require.resolve("crypto-browserify") }'
        - install 'crypto-browserify'
If you don't want to include a polyfill, you can use an empty module like this:
        resolve.fallback: { "crypto": false }
 @ ./node_modules/twitter-api-v2/dist/client/readonly.js 10:24-65
 @ ./node_modules/twitter-api-v2/dist/client/index.js 68:17-38
 @ ./node_modules/twitter-api-v2/dist/index.js 17:15-34 19:13-32
 @ ./src/handler.ts 4:25-50
 @ ./src/index.ts 3:18-38

ERROR in ./node_modules/twitter-api-v2/dist/client-mixins/request-handler.helper.js 7:16-32
Module not found: Error: Can't resolve 'https' in '/home/marlin/Desktop/cloudflare-workers/my-typescript-worker/node_modules/twitter-api-v2/dist/client-mixins'

BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
This is no longer the case. Verify if you need this module and configure a polyfill for it.

If you want to include a polyfill, you need to:
        - add a fallback 'resolve.fallback: { "https": require.resolve("https-browserify") }'
        - install 'https-browserify'
If you don't want to include a polyfill, you can use an empty module like this:
        resolve.fallback: { "https": false }
 @ ./node_modules/twitter-api-v2/dist/stream/TweetStream.js 27:49-99
 @ ./node_modules/twitter-api-v2/dist/index.js 25:13-44
 @ ./src/handler.ts 4:25-50
 @ ./src/index.ts 3:18-38

ERROR in ./node_modules/twitter-api-v2/dist/v1/client.v1.write.js 27:24-37
Module not found: Error: Can't resolve 'fs' in '/home/marlin/Desktop/cloudflare-workers/my-typescript-worker/node_modules/twitter-api-v2/dist/v1'
 @ ./node_modules/twitter-api-v2/dist/v1/client.v1.js 10:42-70
 @ ./node_modules/twitter-api-v2/dist/index.js 20:13-38
 @ ./src/handler.ts 4:25-50
 @ ./src/index.ts 3:18-38

ERROR in ./node_modules/twitter-api-v2/dist/v1/media-helpers.v1.js 23:24-37
Module not found: Error: Can't resolve 'fs' in '/home/marlin/Desktop/cloudflare-workers/my-typescript-worker/node_modules/twitter-api-v2/dist/v1'
 @ ./node_modules/twitter-api-v2/dist/v1/client.v1.write.js 28:27-56
 @ ./node_modules/twitter-api-v2/dist/v1/client.v1.js 10:42-70
 @ ./node_modules/twitter-api-v2/dist/index..js 20:13-38
 @ ./src/handler.ts 4:25-50
 @ ./src/index.ts 3:18-38

5 errors have detailed information that is not shown.
Use 'stats.errorDetails: true' resp. '--stats-error-details' to show it.

webpack 5.38.1 compiled with 5 errors in 2089 ms
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] build: `webpack`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/marlin/.npm/_logs/2022-01-04T13_07_54_794Z-debug.log
Error: Build failed! Status Code: 1