Socket
Socket
Sign inDemoInstall

pg-range-parser

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pg-range-parser

Parses postgres range types


Version published
Maintainers
1
Created
Source

PG Range

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.

API

Root Namespace

.parse( String ) -> Object

Parse a range from a string

.serialize( Object ) -> String

Serialize a range object

Keywords

FAQs

Package last updated on 24 Jun 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc