Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including parse-db-url with all npm packages installed. Try it out:

var parseDbUrl = require("parse-db-url")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

parse-db-url v0.0.0

parse database URLs into configuration objects

parse-db-url

API

module.exports := (String) => {
    adapter:  String,
    host:     String?,
    port:     String?,
    database: String?,
    user:     String?,
    password: String?
}

Turn a string database URL into an object. This differs from a plain require('url').parse(...) in that it understands some conventions around different database drivers and query-string parameters can override those found earlier in the URL. (e.g. user=foo in the query string overrides a bar@host in the URL.

License

2-clause BSD

Metadata

RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free