Socket
Socket
Sign inDemoInstall

parse-connection-url

Package Overview
Dependencies
11
Maintainers
1
Versions
21
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    parse-connection-url

A Nodejs module that allows you to parse connection strings/objects in a consistent way.


Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Install size
3.53 MB
Created
Weekly downloads
 

Readme

Source

Parse Connection Url

Standard - JavaScript Style Guide

A Nodejs module that allows you to parse connection strings/objects in a consistent way.

Table of Contents

Documentation

Click on the following link to go to the full documentation. Documentation

Installation

npm i -S parse-connection-url

Usage

const Connection = require('parse-connection-url')
const httpConn = new Connection('http://admin:admin@localhost:8443/some/path')
console.log(httpConn)
// {
//   connection: 
//    { secure: false,
//      protocol: 'http',
//      port: 8443,
//      path: '/some/pathn',
//      hostname: 'localhost' },
//   auth: { username: 'admin', password: 'admin' } }
console.log(httpConn.toUrl())
// "http://admin:admin@localhost:8443/some/path"

const knexPostgresConn = new Connection('postgres://admin:admin@localhost:5432/generic_database')
console.log(knexPostgresConn)
//  {
//   connection: 
//    { secure: false,
//      protocol: 'postgres',
//      port: 5432,
//      path: '/generic_database',
//      hostname: 'localhost' },
//   auth: { username: 'admin', password: 'admin' } }
console.log(knexPostgresConn.toKnexConnection())
// { host: 'localhost',
//   user: 'admin',
//   password: 'admin',
//   port: 5432,
//   database: 'generic_database' }

Support

Please open an issue for support.

Contributing

Keywords

FAQs

Last updated on 11 Jul 2019

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc