JSPM

  • Created
  • Published
  • Downloads 57159
  • Score
    100M100P100Q180904F
  • License MIT

URL Connection String Parser.

Package Exports

  • connection-string

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (connection-string) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

connection-string

URL Connection String Parser - for all browsers and Node.js versions.

Build Status Coverage Status

Takes a URL connection string:

protocol://user:password@hostname:port/segment1/segment2?param1=value1&param2=value2

and converts it into an object:

{
    protocol: 'protocol',
    user: 'user',
    password: 'password',
    host: 'hostname:port',
    hostname: 'hostname',
    port: 'port',
    segments: ['segment1', 'segment2'],
    params: {
        param1: 'value1',
        param2: 'value2'
    }
}

Installing

$ npm install connection-string

Loading

  • Node.js
var parse = require('connection-string');
  • Browser
<script src="./connection-string"></script>

<script>
    // function parseConnectionString is available here
</script>

Usage

See Wiki Examples.