ts-parse-database-url
TypeScript icon, indicating that this package has built-in type declarations

1.0.3 • Public • Published

TypeScript Parse Database Url

Install

$ npm i ts-parse-database-url

Usage

import parseDatabaseUrl from 'ts-parse-database-url';

const dbUrl = 'mysql://someuser@server.heroku.com:1337/herokudb'
const parsed = parseDatabaseUrl(dbUrl)

/**
 * parsed = {
 *   'driver': 'mysql',
 *   'user': 'someuser',
 *   'host': 'server.heroku.com',
 *   'port': '1337',
 *   'database': 'herokudb'
 * }
*/

Look at src/__tests__ for more tests examples.

Thanks to https://github.com/pwnall/node-parse-database-url for creating the original lib 🎉

Dependencies (1)

Dev Dependencies (6)

Package Sidebar

Install

npm i ts-parse-database-url

Weekly Downloads

22,138

Version

1.0.3

License

ISC

Unpacked Size

6.78 kB

Total Files

5

Last publish

Collaborators

  • herlon214