Project-OSRM / osrm-backend

Open Source Routing Machine - C++ backend
http://map.project-osrm.org
BSD 2-Clause "Simplified" License
6.21k stars 3.29k forks source link

Node.js bindings should make binaries easily accessible #4377

Open daniel-j-h opened 6 years ago

daniel-j-h commented 6 years ago

At the moment using the pre-built osrm binaries we ship with the bindings are cumbersome to use

./node_modules/osrm/lib/binding/osrm-extract ..

we should make that easier for users - looks like there is a bin field we should use:

https://docs.npmjs.com/files/package.json#bin https://docs.npmjs.com/files/package.json#directoriesbin

danpat commented 6 years ago

The approach taken by https://github.com/Project-OSRM/osrm-backend/pull/4386 unfortunately didn't work - the bin symlinking step tries to occur before node-pre-gyp has downloaded the binaries, and npm throws an error.

I described some more detail here: https://github.com/Project-OSRM/osrm-backend/pull/4386#issuecomment-322554560

TL;DR - if we want convenient binaries in the PATH in node_modules/.bin, we'll need to create wrapper scripts that can be installed by npm happily, and know how to call the actual binaries that will be downloaded later in the installation.

I've reverted the original PR for now to unblock OSRM 5.11

github-actions[bot] commented 3 weeks ago

This issue seems to be stale. It will be closed in 30 days if no further activity occurs.