0.0.1 • Published 12 years ago
key-range v0.0.1
key-range
return whether a string key is within a levelup-style range
example
var range = require('key-range');
console.log(range('abc', { start: 'aaa', end: 'azz' }));
console.log(range('xyz', { lt: 'xyz' }));
console.log(range('gz', { gte: 'gz' }));
console.log(range('qrs', { gt: 'q', lt: 'r' }));output:
true
false
true
truemethods
var range = require('key-range')range(key, opts)
Return a boolean: whether the string key matches the range constraints given
by opts.
opts may include any one of:
opts.startopts.endopts.ltopts.lteopts.gtopts.gteopts.minopts.max
These correspond to the range options supported by
levelup, although {lt,gt}{,e} is
the preferred form.
install
With npm do:
npm install key-rangelicense
MIT

