source: trip-planner-front/node_modules/lines-and-columns/README.md@ e29cc2e

Last change on this file since e29cc2e was e29cc2e, checked in by Ema <ema_spirova@…>, 3 years ago

primeNG components

  • Property mode set to 100644
File size: 533 bytes
Line 
1# lines-and-columns
2
3Maps lines and columns to character offsets and back. This is useful for parsers
4and other text processors that deal in character ranges but process text with
5meaningful lines and columns.
6
7## Install
8
9```
10$ npm install [--save] lines-and-columns
11```
12
13## Usage
14
15```js
16import { LinesAndColumns } from 'lines-and-columns'
17
18const lines = new LinesAndColumns(
19 `table {
20 border: 0
21}`
22)
23
24lines.locationForIndex(9)
25// { line: 1, column: 1 }
26
27lines.indexForLocation({ line: 1, column: 2 })
28// 10
29```
30
31## License
32
33MIT
Note: See TracBrowser for help on using the repository browser.