Skip to content

Latest commit

 

History

History
26 lines (21 loc) · 690 Bytes

README.md

File metadata and controls

26 lines (21 loc) · 690 Bytes

Monocart Locator

A Locator for the source code position between offset and line/column.

Features

  • Position locator
  • Line parser
  • Comment parser

Install

npm i monocart-locator

Usage

const locator = new Locator(source);
console.log(locator.lines);
console.log(locator.comments);

const offset = locator.locationToOffset({ line: 1, column: 1 });
const loc = locator.offsetToLocation(10);