I am developing a command line node module and would like to be able to launch it via links on a website.
I want to register a custom protocol my-module://
Here's how I did on Mac OS with an application NW.js :
Open the app /Applications/Utilities/Script Editor
type the following code in the editor
on open location this_URL
do shell script "/Applications/X.app/Contents/MacOS/x '" & this_URL & "'"
end open location
Replace X by the name of your App.
Save the script as an Application Bundle anywhere
Go to the script, right click then 'Show Package Contents' then edit Contents/info.plist
Add these lines at the end of the file, just before :
CFBundleIdentifier
com.mycompany.AppleScript.AppName
CFBundleURLTypes
CFBundleURLName
AppName
CFBundleURLSchemes
myurlscheme
You can now open a link starting with myurlscheme: and see your app is opening!