1.0.2 • Published 12 months ago

monocart-locator v1.0.2

Weekly downloads
-
License
MIT
Repository
-
Last release
12 months ago

Monocart Locator

npm.io npm.io npm.io

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);
1.0.2

12 months ago

1.0.1

12 months ago

1.0.0

1 year ago