geostyler / geostyler-cli

BSD 2-Clause "Simplified" License
22 stars 8 forks source link

Create executables of geostyler-cli #346

Closed jansule closed 1 month ago

jansule commented 1 year ago

It would be nice to create executables of geostyler-cli that can run without having node installed. Such an executable could be used e.g. in order to create a QGIS plugin that allows the conversion from/to other formats from within QGIS. With the current setup users would have to have nodejs installed on their systems, which is probably not the case for non-developers.

Maybe it might be worth to check out https://github.com/nexe/nexe for creating such executables.

geographika commented 1 year ago

Some other options discussed at https://github.com/leafac/caxa#prior-art It looks like https://github.com/vercel/pkg might be the most widely used approach?

geographika commented 1 year ago

This worked surprisingly well! From within the geostyler-cli folder, once the /dist output has been created:

npm install -g pkg
pkg dist/src/index.js --output geostyler

This produced the following file (running on Windows):

image

I copied this to a clean Windows machine with the test data:

geostyler -s sld -t qgis -o D:\Temp D:\Temp\testdata

Output created as expected!