pocket-editor
TypeScript icon, indicating that this package has built-in type declarations

2.3.0 • Public • Published

Github - Npm - Example


This is yet another wysiwyg editor, it focuses mainly on two things:

  • Very fast load time
  • Reliable markdown output

Install

npm install pocket-editor

What you can do

interface Options {
  text?: string
  id?: string
  defer?: true | number 
}

class PocketEditor {
  constructor(selector: string, options?: Options)
  get value(): string
  set value(string): void
  oninput: ((content: string) => void) => void
}

How to use

<body>
    <div id="wrapper"></div>
</body>
import PocketEditor from "pocket-editor"
import "pocket-editor/style.css"

const editor = new PocketEditor("#wrapper")

editor.value = "## Hello world !!"

editor.oninput((content) => {
    console.log(content)
})

Keybindings

Keybind Action
Ctrl + Shift + 1 To big heading
Ctrl + Shift + 2 To medium heading
Ctrl + Shift + 3 To small heading
Ctrl + Shift + 4 To bullet list
Ctrl + Shift + 5 To todo list
Ctrl + Shift + 6 To normal line

Ctrl is Cmd key on MacOS

Developement

# Install pnpm to use these scripts
npm i -g pnpm

# First install all
pnpm i -r

pnpm dev
pnpm preview
pnpm build

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
2.3.07latest

Version History

VersionDownloads (Last 7 Days)Published
2.3.07
2.2.20
2.2.10
2.2.00
2.1.10
2.1.00
2.0.00
1.11.20
1.11.10
1.11.00
1.10.10
1.10.00
1.9.30
1.9.20
1.9.14
1.9.00
1.8.71
1.8.60
1.8.51
1.8.40
1.8.30
1.8.20
1.8.10
1.8.00
1.7.30
1.7.21
1.7.10
1.7.01
1.6.20
1.6.10
1.6.00
1.5.30
1.5.20
1.5.10
1.5.00
1.4.30
1.4.20
1.4.10
1.4.00
1.3.10
1.3.00
1.2.10
1.2.00
1.1.00
1.0.20
1.0.11
1.0.01

Package Sidebar

Install

npm i pocket-editor

Weekly Downloads

13

Version

2.3.0

License

MIT

Unpacked Size

45.9 kB

Total Files

19

Last publish

Collaborators

  • victr