Socket
Book a DemoInstallSign in
Socket

postgres-interval

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

postgres-interval

Parse Postgres interval columns

Source
npmnpm
Version
1.0.2
Version published
Weekly downloads
18M
-2.2%
Maintainers
1
Weekly downloads
 
Created
Source

postgres-interval Build Status

Parse Postgres interval columns

Install

$ npm install --save postgres-interval

Usage

var parse = require('postgres-interval')
var interval = parse('01:02:03')
//=> {hours: 1, minutes: 2, seconds: 3}
interval.toPostgres()
// 3 seconds 2 minutes 1 hours

API

parse(pgInterval) -> interval

pgInterval

Required
Type: string

A Postgres interval string.

interval.toPostgres() -> string

Returns an interval string. This allows the interval object to be passed into prepared statements.

License

MIT © Ben Drucker

Keywords

postgres

FAQs

Package last updated on 12 Apr 2016

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