# parse-database-url

> Database configuration URL parser for node.js

Latest version **0.3.0** (published 2016-01-11) · MIT license · 0 weekly downloads

## Install

```sh
npm install parse-database-url
pnpm add parse-database-url
yarn add parse-database-url
bun add parse-database-url
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.3.0 |
| Published | 2016-01-11 |
| First published | 2013-04-15 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >= 0.6 |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 22 |
| Author | Victor Costan |
| Maintainers | pwnall |
| Keywords | database, configuration, url, heroku, database_url |

## Links

- npm: https://www.npmjs.com/package/parse-database-url
- Repository: https://github.com/pwnall/node-parse-database-url
- Issues: https://github.com/pwnall/node-parse-database-url/issues
- npm.io page: https://npm.io/package/parse-database-url

## Dependencies (1)

- [mongodb-uri](https://npm.io/package/mongodb-uri.md) >= 0.9.7

## Alternatives

- [jsforce](https://npm.io/package/jsforce.md) — 851.2K weekly downloads
- [react-native-qrcode-svg](https://npm.io/package/react-native-qrcode-svg.md) — 693.5K weekly downloads
- [@salesforce/plugin-data](https://npm.io/package/@salesforce/plugin-data.md) — 394.9K weekly downloads
- [@backstage/plugin-search-common](https://npm.io/package/@backstage/plugin-search-common.md) — 308.5K weekly downloads
- [@chain-registry/types](https://npm.io/package/@chain-registry/types.md) — 38.4K weekly downloads

## Recent versions

- 0.3.0 (latest) — 2016-01-11
- 0.2.2 — 2014-12-02
- 0.2.1 — 2014-10-13
- 0.2.0 — 2013-06-03
- 0.1.0 — 2013-04-15

## README

# DATABASE_URL parser for node.js

[![Build Status](https://travis-ci.org/pwnall/node-parse-database-url.svg)](https://travis-ci.org/pwnall/node-parse-database-url)
[![NPM Version](http://img.shields.io/npm/v/parse-database-url.svg)](https://www.npmjs.org/package/parse-database-url)

This is an [npm](https://npmjs.org/) package that parses database
configurations passed in as URLs. This is typically useful in Heroku
deployments, where the database configuration is given in the `DATABASE_URL`
environment variable.


## Supported Platforms

This library is tested against the following platforms.

* [node.js](http://nodejs.org/) 0.6
* [node.js](http://nodejs.org/) 0.8
* [node.js](http://nodejs.org/) 0.10

Keep in mind that the versions above are not hard requirements.


## Installation and Usage

The preferred installation method is to add the library to the `dependencies`
section in your `package.json`.

```json
{
  "dependencies": {
    "parse-database-url": "*"
  }
}
```

Alternatively, `npm` can be used to install the library directly.

```bash
npm install parse-database-url
```

Once the library is installed, `require`-ing it returns the function that
parses URLs.

```javascript
var parseDbUrl = require("parse-database-url");
```

And you can use that to parse URLs :)

```javascript
var dbConfig = parseDbUrl(process.env["DATABASE_URL"]);
```


## Development

The library comes with unit tests. Please make sure they pass before submitting
a pull request.

```bash
npm install
npm test
```

If you modify the parser, please add test cases showing your changes to
[test/parse_cases.json](test/parse_cases.json).


## Copyright and License

The library is Copyright (c) 2013 Victor Costan, and distributed under the MIT
License.

---
_Source: https://npm.io/package/parse-database-url · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
