
Security News
Axios Supply Chain Attack Reaches OpenAI macOS Signing Pipeline, Forces Certificate Rotation
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.
Pimping textareas with editor features.
Editrrr was heavily inspired by Behave.js, so parts of this readme will be similar as well.
Editrrr is a lightweight library for adding IDE style behaviors to plain text areas, making it much more enjoyable to write code in.
npm install editrrr
import Editrrr from 'editrrr';
// create an instance (with the defaults)
const editrrr = new Editrrr({
textarea: null,
replaceTab: true,
softTabs: true,
tabSize: 2,
autoOpen: true,
overwrite: true,
autoStrip: true,
autoIndent: true,
continueList: true,
moveLine: true,
duplicateLine: true,
});
textarea: Textarea element to apply the behaviors toreplaceTab: If set to true, replaceTab does three different things:
softTabs: If set to true, spaces will be used instead of a tab charactertabSize: If softTabs is set to true, the number of spaces used is defined here. If set to false, the CSS property tab-size will be used to define hard tab sizes.autoOpen: If any of the following characters are typed, their counterparts are automatically added:
( adds ){ adds }[ adds ]" adds "' adds 'overwrite: If you type a closing character directly before an identical character, it will overwrite it instead of adding it. Best used with autoOpen set to trueautoStrip: If set to true, and your cursor is between two paired characters, pressing backspace will delete both instead of just the firstautoIndent: If set to true, automatic indentation of your code will be attempted. Best used with autoOpen set to truecontinueList: If set to true, Markdown lists (and GFM style task lists) are continued when pressing entermoveLine: If set to true, lines can be moved up and down using alt+up/downduplicateLine: If set to true, lines can be duplicated using shift+alt+up/downeditrrr.getLineNr(pos); // get the line number (0 based)
editrrr.getLine(pos); // get the line
editrrr.getLineCursor(pos); // get the cursor position on the line
editrrr.getLines(); // get all lines
editrrr.getCursor(); // get the cursor position
editrrr.setCursor(start, end); // set the cursor position
editrrr.getSelection(); // get the selection
editrrr.levelsDeep(pos); // get the levels of indetation
editrrr.addEvent(name, fn); // add event listener
editrrr.removeEvent(name, fn); // remove event listener
editrrr.focus(); // focus the textarea
editrrr.blur(); // blur the textarea
editrrr.value; // get the value
editrrr.value = 'add some text'; // set the value
editrrr.init(); // init function
editrrr.destroy(); // remove all behaviors
Editrrr.addHook(['name'], (editrrr, e) => {});
Editrrr.getHook('name');
Every hook function will receive 2 arguments:
editrrr: the Editrrr instancee: the event dataCalled before initializing Behave
Called after initializing Behave
Called before inserting the text triggered by the enter key
Called after inserting the text triggered by the enter key
Called before deleting the text triggered by the delete key
Called after deleting the text triggered by the delete key
Called before inserting the text triggered by the tab key
Called after inserting the text triggered by the tab key
Called before modifying the text triggered by the keyup event
Called after modifying the text triggered by the keydown event
Called after modifying the text triggered by the input event
Called before modifying the text triggered by an opening character
Called after modifying the text triggered by an opening character
Called before modifying the text triggered by an closing character
Called after modifying the text triggered by an closing character
Called before removing all the behavoirs
Called after removing all the behaviors
FAQs
Pimping textarea with editor features.
We found that editrrr demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.

Security News
Open source is under attack because of how much value it creates. It has been the foundation of every major software innovation for the last three decades. This is not the time to walk away from it.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.