# @editorjs/caret

> Utils useful for work with caret for Editor.js tools development

Latest version **1.1.0** (published 2026-04-15) · MIT license · 0 weekly downloads

## Install

```sh
npm install @editorjs/caret
pnpm add @editorjs/caret
yarn add @editorjs/caret
bun add @editorjs/caret
```

## Health

**Score 45/100 (D)** — status: active.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

## Facts

| | |
|---|---|
| Version | 1.1.0 |
| Published | 2026-04-15 |
| First published | 2024-08-14 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 20.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | codex-team |

## Links

- npm: https://www.npmjs.com/package/@editorjs/caret
- Repository: https://github.com/editor-js/utils/tree/main/packages/caret
- npm.io page: https://npm.io/package/@editorjs/caret

## Dependencies (1)

- [@editorjs/dom](https://npm.io/package/@editorjs/dom.md) ^1.1.0

## Recent versions

- 1.1.0 (latest) — 2026-04-15
- 1.0.3 — 2024-11-06
- 1.0.2 — 2024-10-09
- 1.0.1 — 2024-10-09
- 1.0.0 — 2024-08-23
- 0.0.11 — 2024-08-23
- 0.0.10 — 2024-08-23
- 0.0.9 — 2024-08-22
- 0.0.8 — 2024-08-22
- 0.0.7 — 2024-08-20
- 0.0.5 — 2024-08-20
- 0.0.4 — 2024-08-17
- 0.0.3 — 2024-08-17
- 0.0.2 — 2024-08-17
- 0.0.1 — 2024-08-14

## README

# @editorjs/caret
Utils useful for work with caret for Editor.js tools development
### Installation 
 ```
   npm install @editorjs/caret
```
### Function list
- [checkContenteditableSliceForEmptiness](https://github.com/editor-js/utils/blob/main/packages/caret/src/checkContenteditableSliceForEmptiness/checkContenteditableSliceForEmptiness.ts) - Checks content at left or right of the passed node for emptiness.
- [focus](https://github.com/editor-js/utils/blob/main/packages/caret/src/focus/focus.ts) - Set focus to contenteditable or native input element
- [getCaretNodeAndOffset](https://github.com/editor-js/utils/blob/main/packages/caret/src/getCaretNodeAndOffset/getCaretNodeAndOffset.ts) - Returns TextNode containing a caret and a caret offset in it
- [getContenteditableSlice](https://github.com/editor-js/utils/blob/main/packages/caret/src/getContenteditableSlice/getContenteditableSlice.ts) - Returns slice of the contenteditable html element from caret position to the start or end (depending on direction)
- [getRange](https://github.com/editor-js/utils/blob/main/packages/caret/src/getRange/getRange.ts) - Returns the first range
- [isCaretAtEndOfInput](https://github.com/editor-js/utils/blob/main/packages/caret/src/isCaretAtEndOfInput/isCaretAtEndOfInput.ts) - Checks if caret is at the end of the passed input
- [isCaretAtStartOfInput](https://github.com/editor-js/utils/blob/main/packages/caret/src/isCaretAtStartOfInput/isCaretAtStartOfInput.ts) - Checks if caret is at the start of the passed input
- [save](https://github.com/editor-js/utils/blob/main/packages/caret/src/save/save.ts) - Saves caret position using hidden <span>
# About CodeX
   <img align="right" width="120" height="120" src="https://codex.so/public/app/img/codex-logo.svg" hspace="50">

   CodeX is a team of digital specialists around the world interested in building high-quality open source products on a global market. We are [open](https://codex.so/join) for young people who want to constantly improve their skills and grow professionally with experiments in cutting-edge technologies.

  | 🌐 | Join  👋  | Twitter | Instagram |
   | -- | -- | -- | -- | 
   | [codex.so](https://codex.so) | [codex.so/join](https://codex.so/join) |[@codex_team](http://twitter.com/codex_team) | [@codex_team](http://instagram.com/codex_team/) |

---
_Source: https://npm.io/package/@editorjs/caret · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
