editor-widget
editor-widget
npm i editor-widget
editor-widget

editor-widget

Editor widget used by slap-editor/slap

by slap-editor

1.1.1 (see all)License:MITTypeScript:Not Found
npm i editor-widget
Readme

editor-widget Build Status

Editor widget used by slap-editor/slap

Example

var blessed = require('blessed');
var Editor = require('editor-widget');

var filePath = './file.txt';

// Create a screen object.
var screen = blessed.screen({
  smartCSR: true
});

screen.title = 'my window title';

// Create editor object
var editor = new Editor({
  parent: screen,
  top: 0,
  left: 0,
  width: '100%',
  height: '100%'
});

editor.open(filePath);

// Save on Control-S.
screen.key(['C-s'], function(ch, key) {
  editor.save(filePath);
});

// Quit on Escape, q, or Control-C.
screen.key(['escape', 'q', 'C-c'], function(ch, key) {
  return process.exit(0);
});

// Render the screen.
screen.render();

Downloads/wk

18

GitHub Stars

19

LAST COMMIT

4yrs ago

MAINTAINERS

1

CONTRIBUTORS

8

OPEN ISSUES

4

OPEN PRs

49
VersionTagPublished
1.1.1
latest
7yrs ago
No alternatives found
No tutorials found
Add a tutorial
No dependencies found

Rate & Review

100
No reviews found
Be the first to rate