Is there a way to do a disk-based binary search for a particular key in a text file in Javascript? The text file is too big to be loaded into memory, but sorted by the key values. In particular I am looking for a way to mimic Perl's Search::Dict functionality in Javascript.
For e.g. If I have a file foo.txt:
a 1
b 10
c 5
z 4
look(c,foo.txt)
should return the line 'c 5
', by doing a binary search and not traversing the file linearly.