New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

editor2

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

editor2

Launch an editor in your Node.js application.

  • 1.0.4
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
6
increased by200%
Maintainers
1
Weekly downloads
 
Created
Source

editor2

Launch an editor in your Node.js application.

(A promised-based interface for editor).

Installing

npm i editor2

Example

const editor = require('editor2')

async function main (file) {
  await editor(file)
  console.log('Done editing')
}

main('/tmp/editor2.txt')
  .catch(err => {
    console.error(err)
    if (err.code) process.exit(err.code)
    if (err.signal) process.kill(err.signal)
  })

API

editor(file, opts={})

Open file in an editor. editor uses this ordering to select the editor:

  1. opts.editor
  2. process.env.VISUAL
  3. process.env.EDITOR
  4. 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.

License

MIT

Keywords

FAQs

Package last updated on 02 May 2018

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc