AimForNaN / usaddress

A Node.js library for parsing unstructured address strings into address components
https://github.com/truefusion/usaddress
MIT License
1 stars 1 forks source link

__dirname not suitable for packaged electron apps #1

Open AimForNaN opened 6 years ago

AimForNaN commented 6 years ago

Packaging an app for electron (to an asar package) that makes use of this module will fail because it can't find the crfsuite model because it is in a different location.

AimForNaN commented 6 years ago

Upon attempting to open the file for reading, because it is stored in an asar package, the crfsuite tagger is not able to access the file like electron is. Looking for alternative to provide data directly instead of from file.

japerr commented 3 years ago

I added the model file to the public folder and used __static variable. https://webpack.electron.build/using-static-assets