tlsClient icon indicating copy to clipboard operation
tlsClient copied to clipboard

Missing CJS Support

Open pepedro12 opened this issue 1 year ago • 2 comments

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!

pepedro12 avatar May 27 '24 19:05 pepedro12

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.

DemonMartin avatar May 27 '24 20:05 DemonMartin

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

pepedro12 avatar May 28 '24 01:05 pepedro12