Handles parsing of postgres range types
install
npm install -S pg-range-parser
usage
var pgRangeType = require('pg-range-parser');
// { start: { value: '2015-01-01', inclusive: true }
// , end: { value: '2015-02-01', inclusive: false }
// }
pgRangeType.parse('[2015-01-01,2015-02-01)')
// '[2015-01-01,2015-02-01)'
pgRangeType.serialize({
start: { value: '2015-01-01', inclusive: true }
, end: { value: '2015-02-01', inclusive: false }
})
pgtype will modify your enums (never drops) and add new types.
Parse a range from a string
Serialize a range object