Socket
Socket
Sign inDemoInstall

ts-parse-database-url

Package Overview
Dependencies
1
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    ts-parse-database-url

Parse database urls


Version published
Weekly downloads
29K
increased by12.92%
Maintainers
1
Install size
18.8 kB
Created
Weekly downloads
 

Readme

Source

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 :tada:

FAQs

Last updated on 25 Jul 2018

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc