Get the user's default editor based on the environment variable $EDITOR
$ npm install --save default-editor
The exe defined by $EDITOR is assumed to be in the $PATH
const defaultEditor = require('default-editor');
// macOS
console.log(defaultEditor);
//=> 'vim'
// Windows
console.log(defaultEditor);
//=> 'notepad.exe'
MIT © Sean Escriva
Directly based on https://github.com/sindresorhus/default-shell and probably less useful.