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

selection-range

Package Overview
Dependencies
Maintainers
2
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

selection-range

get or set the selction range, or cursor position, for contenteditable

latest
Source
npmnpm
Version
1.1.0
Version published
Weekly downloads
245
-48.42%
Maintainers
2
Weekly downloads
 
Created
Source

selection-range

Get or set the selection range, or cursor position. Useful for saving and restoring selections when your are programatically changing the dom.

Installation

$ component install bmcmahen/selection-range
$ npm install selection-range

Usage

var select = require('selection-range');
select(el, { start: 5, end: 25 }); // select range of el from 5 - 25
select(el, { start: 5 }); // set the cursor at 5
var pos = select(el); // get range of selection
// pos.start = start index
// pos.end = end index
// pos.atStart = boolean. true if cursor should appear at start of el
// pos = undefined if no cursor
select(el, pos);

Tests

npm install component-test -g
component test browser

License

MIT

FAQs

Package last updated on 03 Jan 2016

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