Skip to content

joshwnj/linemap

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LineMap

Make conversions between character offsets and line numbers.

Usage

var LineMap = require('linemap');
var linemap = new LineMap(somestring);

// find out the character offset for the beginning of line 2
var offset = linemap.getOffsetForLine(2);

// find out what line number the character at offset 44 is on
var line = linemap.getLineForOffset(44);

License

MIT

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published