monocart-locator
v1.0.2
Published
Monocart Locator
Downloads
793,837
Readme
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);