1.3.1 • Published 5 years ago

@thetrg/editor-widget v1.3.1

Weekly downloads
-
License
MIT
Repository
github
Last release
5 years ago

editor-widget

Editor widget forked from the slap text editor. This is for maintenance.

Example

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

const screen = blessed.screen({smartCSR: true, title: "editor-widget example"});
const editor = new Editor({
  // normal blessed widget, use like you would any other blessed element
  parent: screen,
  top: 0,
  left: 0,
  width: '100%',
  height: '100%'
});

const filePath = './file.txt';
editor.open(filePath);
screen.key(['C-s'], (ch, key) => { editor.save(filePath); });

screen.key(['escape', 'q', 'C-c'], (ch, key) => { process.exit(0); });
screen.render();

In use

Here are some projects that use editor-widget: