@usheninte/postgres-parser

0.1.1 • Public • Published

postgres-parser

Parses PostgreSQL database URL string and returns values for user, password, host, port and database name.

Installation

npm install @usheninte/postgres-parser
// OR
yarn add @usheninte/postgres-parser

Do the following to use the package

const dbstring = require('@usheninte/postgres-parser');

const { user, password, host, port, name } = dbstring(
  'postgres://USER:PASSWORD@HOST:PORT/NAME',
);

Output from the following test string postgres://USER:PASSWORD@HOST:PORT/NAME

{
  "user": "USER",
  "password": "PASSWORD",
  "host": "HOST",
  "port": "PORT",
  "name": "NAME"
}

Readme

Keywords

Package Sidebar

Install

npm i @usheninte/postgres-parser

Weekly Downloads

0

Version

0.1.1

License

MIT

Unpacked Size

2.76 kB

Total Files

3

Last publish

Collaborators

  • usheninte