🚀 Big News:Socket Has Acquired Secure Annex.Learn More →
Socket
Book a DemoSign in
Socket

editors

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

editors

attempts to launch a text editor in your program, it will always prefer $EDITOR, but knows a little more :)

latest
Source
npmnpm
Version
1.1.4
Version published
Weekly downloads
19
-34.48%
Maintainers
1
Weekly downloads
 
Created
Source

editors

attempts to launch a text editor in your program, lookup for $VISUAL || $EDITOR, but knows a little more :)

example

var editor = require('editors');
editor('beep.json', function (code, sig) {
    console.log('finished editing with code ' + code);
});

var opts = {
    editor: 'vim',
    editors: ['vim', 'vi', 'gedit']
};
editor('beep.json', function (code, sig) {
    console.log('finished editing with code ' + code); // code => 0
});

methods

var editor = require('editors')

editor(file, opts={}, cb)

Launch the opts.editor || $VISUAL || $EDITOR for file.

Fallback to a list of well known editors for linux, windows platforms.

When the first editor exits without throwing a startup error, cb(code, sig) fires.

install

With npm do:

npm install editors

todo

  • mac, freebsd and all others deserves compatibility. Feel free to issue about your system with some suggestions.

notes

Forked from substack/editor to improve it.

license

MIT

Keywords

text

FAQs

Package last updated on 24 Jun 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts