mnater / Hyphenopoly

Hyphenation for node and Polyfill for client-side hyphenation.
http://mnater.github.io/Hyphenopoly/
MIT License
696 stars 44 forks source link

Stop using fs module #196

Closed valdirunars closed 2 years ago

valdirunars commented 2 years ago

I might be wrong here but at first glance it looks like all that fs is doing is load stuff into memory.

Maybe then just have everything in code (maybe generated .ts files from the original .data and .txt)

That way this module would also be available in ReactNative and other none node.js runtimes

mnater commented 2 years ago

Yep, the loader-code is outdated. I think it dates back to 2018 when there was no fetch() or import or dynamic require() available in node. Or I just didn't know how to code this correctly...

Anyhow - this needs some work (see https://github.com/mnater/Hyphenopoly/issues/195, too).

Until this is rolled out you may use a different loader: https://mnater.github.io/Hyphenopoly/Node-Module.html#loader

I'd highly appreciate a minimal ReactNative example for testing purposes if you can find the time.

mnater commented 2 years ago

https://github.com/mnater/Hyphenopoly/tree/loader

StephanHoyer commented 2 years ago

great change!

Usage is now much simpler, also the crazy path-generation is gone.

Great work, @mnater!