@relekang/cli-editor

1.1.1 • Public • Published

cli-editor

This is a simple editor that can be used to edit javascript objects with the current editor in the terminal. The editor is fetched with EDITOR environment variable.

Installation

npm install @relekang/cli-editor

or

yarn add @relekang/cli-editor

Usage

import {edit} from "@relekang/cli-editor"

edit({
    fetch: async function() { return getItem() },
    save: async function(item) { return saveItem(item) },
    errorHandler: function (error) {
        return {retry: true, message: "Could not save due to " + error.toString()}
    },
})
.catch(error => console.error("ooops", error))

Readme

Keywords

none

Package Sidebar

Install

npm i @relekang/cli-editor

Weekly Downloads

0

Version

1.1.1

License

MIT

Unpacked Size

8.09 kB

Total Files

6

Last publish

Collaborators

  • relekang