string-pos
Usage
var stringPos = ;var sample = "abc\n\n123\n \ndef"; //-> {line:1, column:0} //-> {line:1, column:2} //-> {line:2, column:0} //-> {line:3, column:2} stringPos //-> 0stringPos //-> 2stringPos //-> 4stringPos //-> 7
Benchmarks
Notes
- Compatible with source-map positions.
- Line numbers are 1 index based.
- Column numbers are zero index based.
License
MIT © Daniel Kalen