editor2
Launch an editor in your Node.js application.
(A promised-based interface for
editor
).
Installing
npm i editor2
Example
const editor = { await console}
API
editor(file, opts={})
Open file in an editor. editor
uses this ordering to select the
editor:
opts.editor
process.env.VISUAL
process.env.EDITOR
notepad
on Windows,vim
on all other operating systems
If the editor exists with a non-zero exit code, editor
throws an
Error
with .code
set to the exit code.
If a signal terminates the editor, editor
throws an Error
with
.signal
set to the signal.