string-range

check if a string is within a range

npm install string-range
235 downloads in the last day
1 754 downloads in the last week
6 581 downloads in the last month

string-range

Check whether a string is within a range.

Example

var ranges = require('string-range')

ranges.satisfies('hello', {min: 'a', max: 'z'})
=> true
ranges.satisfies('Hello', {min: 'a', max: 'z'})
=> false

//force a range inside a prefix!

ranges.satisfies('TYPE~key', ranges.prefix({min:'a', max:'z'}, 'TYPE')
=> true

min and max are alaises for start and end.

License

MIT

npm loves you