Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

string-editor

mafintosh3.3k0.1.2

Edit a string using $EDITOR from within your node app.

string, editor, edit, env, cli, app

readme

string-editor

Edit a string using $EDITOR from within your node app.

npm install string-editor

Usage

var edit = require('string-editor');

// this launches your $EDITOR with a tmp file containing "hello world"
edit('hello world', function(err, result) {
    // when you are done editing result will contain the string
    console.log(result);
});

Sometimes it can be useful to set an filename to help your editor to enable highlighting etc.

// we pass app.js as a filename to help with highlighting
edit('var a = 42;', 'app.js', function(err, result) {
    console.log(result);
})

Note that app.js will still be a tmp file

License

MIT