mnater / Hyphenopoly

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

Stop using fs module #196

Closed valdirunars closed 1 year ago

valdirunars commented 1 year 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 1 year 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 1 year ago

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

StephanHoyer commented 1 year ago

great change!

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

Great work, @mnater!