external-editor

  • Version 3.1.0
  • Published
  • 27 kB
  • 3 dependencies
  • MIT license

Install

npm i external-editor
yarn add external-editor
pnpm add external-editor

Overview

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

Index

Functions

function edit

edit: (text?: string, fileOptions?: IFileOptions) => string;

    function editAsync

    editAsync: (
    text: string,
    callback: StringCallback,
    fileOptions?: IFileOptions
    ) => void;

      Classes

      class CreateFileError

      class CreateFileError extends Error {}
      • * Node External Editor

        Kevin Gravier <kevin@mrkmg.com> MIT 2018

      constructor

      constructor(originalError: Error);

        property originalError

        originalError: Error;

          class ExternalEditor

          class ExternalEditor {}

            constructor

            constructor(text?: string, fileOptions?: IFileOptions);

              property editor

              editor: IEditorParams;

                property last_exit_status

                readonly last_exit_status: number;

                  property lastExitStatus

                  lastExitStatus: number;

                    property temp_file

                    readonly temp_file: string;

                      property tempFile

                      tempFile: string;

                        property text

                        text: string;

                          method cleanup

                          cleanup: () => void;

                            method run

                            run: () => string;

                              method runAsync

                              runAsync: (callback: StringCallback) => void;

                                class LaunchEditorError

                                class LaunchEditorError extends Error {}
                                • * Node External Editor

                                  Kevin Gravier <kevin@mrkmg.com> MIT 2018

                                constructor

                                constructor(originalError: Error);

                                  property originalError

                                  originalError: Error;

                                    class ReadFileError

                                    class ReadFileError extends Error {}
                                    • * Node External Editor

                                      Kevin Gravier <kevin@mrkmg.com> MIT 2018

                                    constructor

                                    constructor(originalError: Error);

                                      property originalError

                                      originalError: Error;

                                        class RemoveFileError

                                        class RemoveFileError extends Error {}
                                        • * Node External Editor

                                          Kevin Gravier <kevin@mrkmg.com> MIT 2018

                                        constructor

                                        constructor(originalError: Error);

                                          property originalError

                                          originalError: Error;

                                            Interfaces

                                            interface IEditorParams

                                            interface IEditorParams {}

                                              property args

                                              args: string[];

                                                property bin

                                                bin: string;

                                                  interface IFileOptions

                                                  interface IFileOptions {}

                                                    property dir

                                                    dir?: string;

                                                      property mode

                                                      mode?: number;

                                                        property postfix

                                                        postfix?: string;

                                                          property prefix

                                                          prefix?: string;

                                                            property template

                                                            template?: string;

                                                              Type Aliases

                                                              type StringCallback

                                                              type StringCallback = (err: Error, result: string) => void;

                                                                type VoidCallback

                                                                type VoidCallback = () => void;

                                                                  Package Files (5)

                                                                  Dependencies (3)

                                                                  Dev Dependencies (11)

                                                                  Peer Dependencies (0)

                                                                  No peer dependencies.

                                                                  Badge

                                                                  To add a badge like this onejsDocs.io badgeto your package's README, use the codes available below.

                                                                  You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/external-editor.

                                                                  • Markdown
                                                                    [![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/external-editor)
                                                                  • HTML
                                                                    <a href="https://www.jsdocs.io/package/external-editor"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>