justin justin - 1 year ago 67
Node.js Question

How can I do the same sort of thing as git editor spawning in node?

I want to spawn an editor in the middle of a program written in Node.js, let the user edit files in the directory opened in the editor, and return control to the program once the new editor instance is closed.

I would imagine I can do this with child_process.spawnSync.

Are there any example packages I can look at on npm which do this?

Answer Source

Take a look at another StackOverflow answer: on opening a EDITOR from Node.js and dealing with the TTY.

(Also consider using GIT_EDITOR end variable in addition to just EDITOR :)

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download