tiny-cli-editor
v0.1.1
Published
A nano-like command line editor.
Downloads
419
Readme
tiny-cli-editor
A nano-like command line editor. Really basic, but very lightweight. Can be used as a programmatically from JS.
The following features are missing, but I'd like to implement them in the future:
- copy to clipboard, paste from it
- ask for confirmation on
ctrl+c
I won't implement these features:
- syntax highlighting
- panels/bars/overlays
- mouse support
- plugin system
tiny-cli-editor uses prompt-skeleton to have a behavior consistent with other prompts.
Installing
npm install tiny-cli-editor # to use it as a library
npm install -g tiny-cli-editor # to use it from the shell
Usage
editor index.js
Ctrl + C
to abort, Ctrl + D
to save the file.
To use tiny-cli-editor programmatically:
const editor = require('tiny-cli-editor')
editor('Hello this is dog.')
.on('data', (text) => {
// do something with the text
})
.on('abort', (text) => {
// do something with the text
})
.on('submit', (text) => {
// do something with the text
})
Related
date-prompt
mail-prompt
multiselect-prompt
number-prompt
range-prompt
select-prompt
text-prompt
tree-select-prompt
cli-autocomplete
switch-prompt
Contributing
If you have a question, found a bug or want to propose a feature, have a look at the issues page.