Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

external-editor

Package Overview
Dependencies
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

external-editor

Edit a string with the users preferred text editor using $VISUAL or $ENVIRONMENT

  • 3.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
27M
increased by4.23%
Maintainers
1
Weekly downloads
 
Created

What is external-editor?

The external-editor npm package allows you to easily invoke and manage external text editors from within your Node.js applications. It is particularly useful when you need to allow users to edit large multi-line texts, which can be cumbersome to handle within a command-line interface. The package takes care of launching the editor, capturing the text once the editor is closed, and handling temporary files.

What are external-editor's main functionalities?

Launch an external editor and get the edited text

This feature launches the default system editor, waits for the user to make changes and save, and then returns the edited text.

const { edit } = require('external-editor');

const text = edit();
console.log(text);

Launch an external editor with predefined text

This feature allows you to launch an external editor with predefined text, which the user can then edit.

const { edit } = require('external-editor');

const initialText = 'Initial content of the file.';
const text = edit(initialText);
console.log(text);

Create an instance of ExternalEditor

This feature provides more control by creating an instance of ExternalEditor, which can be used to run the editor and clean up temporary files manually.

const { ExternalEditor } = require('external-editor');

const editor = new ExternalEditor();
const text = editor.run();
editor.cleanup();
console.log(text);

Other packages similar to external-editor

Keywords

FAQs

Package last updated on 08 Jul 2019

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