Files
NapCatQQ/.pnpm-store/v3/files/f7/e281d73f77090e337556b517b47af5e1df1feaf772f8e32dfa4402c60719eba2520575efef2ae908c79d28fba2703d0bbd016c59ae9d1d9f725753041d8f04
T
TanTan e311ca3275
Build NapCat Artifacts / Type Check & Test (push) Waiting to run
docs: 仓库链接指向本镜像仓库
2026-11-13 09:25:58 +08:00

34 lines
533 B
Plaintext

# lines-and-columns
Maps lines and columns to character offsets and back. This is useful for parsers
and other text processors that deal in character ranges but process text with
meaningful lines and columns.
## Install
```
$ npm install [--save] lines-and-columns
```
## Usage
```js
import { LinesAndColumns } from 'lines-and-columns'
const lines = new LinesAndColumns(
`table {
border: 0
}`
)
lines.locationForIndex(9)
// { line: 1, column: 1 }
lines.indexForLocation({ line: 1, column: 2 })
// 10
```
## License
MIT