2.0.2 • Published 6 years ago

save-selection v2.0.2

Weekly downloads
4
License
MIT
Repository
github
Last release
6 years ago

save-selection

Save & restore selections in a document, using <mark> elements

Installation

Download node at nodejs.org and install it, if you haven't already.

npm install save-selection --save

Usage

import {save, restore} from 'save-selection';

// will save selections in <mark> elements
// with classes "selection-start" & "selection-end"
save(document.querySelector('#main'));

// will restore selections,
// setting start to a <mark> element with class selection-start
// and end with class selection-end
restore(document.querySelector('#main'));

Tests

npm install
npm test

Dependencies

Dev Dependencies

License

MIT

Generated by package-json-to-readme