xopen - Open a file with the default application
xopenprovides a dead-simple Promise API for opening files from Node on Windows, macOS, and Linux:
filepathis a path to the file you wish to open. When you call
xopen(), it returns a
Promisethat is resolved with the contents of
stdoutif the application successfully opens, and is rejected with an error if the application fails to open.
It's that easy.