Parse Connection Url
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 = const httpConn = 'http://admin:admin@localhost:8443/some/path'console// {// connection: // { secure: false,// protocol: 'http',// port: 8443,// path: '/some/pathn',// hostname: 'localhost' },// auth: { username: 'admin', password: 'admin' } }console// "http://admin:admin@localhost:8443/some/path" const knexPostgresConn = 'postgres://admin:admin@localhost:5432/generic_database'console// {// connection: // { secure: false,// protocol: 'postgres',// port: 5432,// path: '/generic_database',// hostname: 'localhost' },// auth: { username: 'admin', password: 'admin' } }console// { host: 'localhost',// user: 'admin',// password: 'admin',// port: 5432,// database: 'generic_database' }
Support
Please open an issue for support.