https://github.com/cannercms/get-selection-range
Get current cursor's selection range
https://github.com/cannercms/get-selection-range
Last synced: 10 months ago
JSON representation
Get current cursor's selection range
- Host: GitHub
- URL: https://github.com/cannercms/get-selection-range
- Owner: CannerCMS
- License: mit
- Created: 2018-04-13T07:18:18.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2018-04-13T08:15:52.000Z (about 8 years ago)
- Last Synced: 2025-08-09T06:57:55.824Z (11 months ago)
- Language: JavaScript
- Size: 73.2 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# get-selection-range [![NPM version][npm-image]][npm-url] [![Dependency Status][daviddm-image]][daviddm-url]
> Get cursor's selection range.
## Installation
```sh
$ npm install --save get-selection-range
```
## Usage
```js
var getSelectionRange = require('get-selection-range');
// get visible selection range
getSelectionRange.getVisibleSelectionRect();
// get collpase selection range
getSelectionRange.getCollapsedClientRect()
```
## License
MIT © [chilijung]()
[npm-image]: https://badge.fury.io/js/get-selection-range.svg
[npm-url]: https://npmjs.org/package/get-selection-range
[travis-image]: https://travis-ci.org/Canner/get-selection-range.svg?branch=master
[travis-url]: https://travis-ci.org/Canner/get-selection-range
[daviddm-image]: https://david-dm.org/Canner/get-selection-range.svg?theme=shields.io
[daviddm-url]: https://david-dm.org/Canner/get-selection-range