New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

small-editor

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

small-editor

project

latest
Source
npmnpm
Version
1.2.0
Version published
Maintainers
1
Created
Source



small-editor

Extremely lightweight text editor

npm

Feature

  • Extremely lightweight, less than 2 KB.
  • Press Tab to insert 4(or more) spaces.
  • Press Shift + Tab to remove 4 spaces.
  • Press Enter to add a new line while keeping the cursor aligned in the same column.
  • Press Enter to add same Markdown prefix to the new line( e.g., *, 1., >, +, -, - [ ], - [x] ).
  • Typing a left character like (, [, {, " will automatically insert the matching right character ), ], }, " respectively.
  • Autosave functionality.
  • Press "=" to automatically calculate the result of the preceding mathematical formula.

Usage

  • Install the package
npm install small-editor --save
  • Import the package
import { Editor } from 'small-editor';
  • Create an instance of the editor
const editor = new Editor({
  container: document.getElementById('editorContainerDiv'),
  history: 'Hello, World!',
  /*
  history: [
    { time: 17000000000, text: 'Hello World V2' },
    { time: 16000000000, text: 'Hello World V1' },
  ],
  */
  onAutoSave: (newHistoryList) => {
    console.log(newHistoryList);
  }
});
  • Get the value of the editor
const textValue = editor.getValue();

License

MIT

FAQs

Package last updated on 09 Nov 2025

Did you know?

Socket

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.

Install

Related posts