qm-util-edit-in-console

0.1.0 • Public • Published

logo-qm

qm-util-edit-in-console npm version code style: prettier

Edit .json data in console using terminal editor (promisfied).

Installation

$ npm i -S qm-util-edit-in-console

Usage

import editInConsole from "qm-util-edit-in-console";
 
  // default options
  const options = {
    fileName: ".tempToEditInVim.json",
    editor: "vim",
    dirPath: process.cwd(),
    removeTempFile: true
  };
 
async function edit() {
  try {
    const objToEdit = { editMe: "terefere" };
    const newObj = await editInConsole(objToEdit, options);
    console.log("newObj ", newObj);
  } catch (error) {
    console.log("Error: ", error);
  }
}();

Credits

Based on substack/node-editor.

License

MIT © qaraluch

Readme

Keywords

none

Package Sidebar

Install

npm i qm-util-edit-in-console

Weekly Downloads

0

Version

0.1.0

License

MIT

Last publish

Collaborators

  • qaraluch