DemonMartin / tlsClient

A wrapper for bogdanfinn/tls-client based on ffi-rs for unparalleled performance and usability. Inspired by @dryft/tlsclient.
https://www.npmjs.com/package/tlsclientwrapper
16 stars 1 forks source link

Missing CJS Support #6

Open guyedry1 opened 1 month ago

guyedry1 commented 1 month ago

Hi. Thanks a lot for this amazing library! Im using pkg and it requires to use ESM module. im import using: const tlsClient =require('tlsclientwrapper'); and getting this error: Error [ERR_REQUIRE_ESM]: require() of ES Module node_modules\tlsclientwrapper\index.js code: 'ERR_REQUIRE_ESM' }

thanks!

DemonMartin commented 1 month ago

Correct. The module does not support CJS. ESM is the new standard. In the past, I tried to add CJS support to the module, but I haven’t found a way to correctly convert all the code. Therefore, I decided to keep ESM.

I have tried multiple ways to create an .exe file, and none have worked.

Deno Compiler, Bun Compiler, NodeJS Compiler, Nexe, PKG, etc.

Feel free to open a pull request if you want to add correctly working CJS using something similar to esbuild, babel, or webpack. However, I haven’t been able to do it.

guyedry1 commented 1 month ago

Thanks for the quick answer. I will update if i find any way.