# caret-position2

> Manage caret/selection on input/textarea. Refactored caret-position.

Latest version **1.0.3** (published 2018-03-13) · 0 weekly downloads

## Install

```sh
npm install caret-position2
pnpm add caret-position2
yarn add caret-position2
bun add caret-position2
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.3 |
| Published | 2018-03-13 |
| First published | 2015-05-06 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Node | * |
| Dependencies | 0 |
| Unpacked size | 5.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Marcus Westin |
| Maintainers | dfcreative |

## Links

- npm: https://www.npmjs.com/package/caret-position2
- Repository: https://github.com/kudago/caret-position
- Homepage: https://github.com/kudago/caret-position.js
- Issues: http://github.com/kudago/caret-position/issues
- npm.io page: https://npm.io/package/caret-position2

## Recent versions

- 1.0.3 (latest) — 2018-03-13
- 1.0.2 — 2015-05-06
- 1.0.1 — 2015-05-06
- 1.0.0 — 2015-05-06

## README

# caret-position2

Get and set the user's text selection on an input or text area.

`$ npm install caret-position2`

```js
var get = require('caret-position2/get');
var set = require('caret-position2/set');

// Set caret position after the first character
set(input, 1)
get(input) // -> { start:1, end:1, caret:1 }

// Set text selection to the second and third character
set(input, 1, 3)
get(input) // -> { start:1, end:3, caret:3 }
```

[![NPM](https://nodei.co/npm/caret-position2.png?downloads=true&downloadRank=true&stars=true)](https://nodei.co/npm/caret-position2/)

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