$ npm install bisect-sorted-setAn in memory sorted set that uses binary search on numeric indexes to find values next to each other.
var Set = require('bisect-sorted-set')
var set = new Set()
set.put(1000, {foo: 'bar'})
set.put(100001, {foo: 'baz'})
set.get(1000) -> {foo: 'bar'}
set.get(1001) -> null
set.gte(1000) -> {foo: 'bar'}
set.gt(1000) -> {foo: 'baz'}
$ npm install bisect-sorted-set
Store value at idx.
Get value at idx, if any.
Get value with index next greater than idx, if any.
Get value with index next greater than or equal to idx, if any.
Get value with index next lower than idx, if any.
Get value with index next lower than or equal to idx, if any.
Delete value at idx, if any.
MIT