AeThex-Engine-Core/services/auth-service/node_modules/lines-and-columns
mrpiglr 190b6b2eab
Some checks failed
Build AeThex Engine / build-windows (push) Has been cancelled
Build AeThex Engine / build-linux (push) Has been cancelled
Build AeThex Engine / build-macos (push) Has been cancelled
Build AeThex Engine / create-release (push) Has been cancelled
Deploy Docsify Documentation / build (push) Has been cancelled
Deploy Docsify Documentation / deploy (push) Has been cancelled
chore: sync local changes to Forgejo
2026-03-13 00:37:06 -07:00
..
build chore: sync local changes to Forgejo 2026-03-13 00:37:06 -07:00
LICENSE chore: sync local changes to Forgejo 2026-03-13 00:37:06 -07:00
package.json chore: sync local changes to Forgejo 2026-03-13 00:37:06 -07:00
README.md chore: sync local changes to Forgejo 2026-03-13 00:37:06 -07:00

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

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