qm-util-edit-in-console
v0.1.0
Published
Edit data in console using terminal editor.
Downloads
0
Readme
qm-util-edit-in-console
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