Socket
Socket
Sign inDemoInstall

dsn

Package Overview
Dependencies
0
Maintainers
2
Versions
5
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

dsn

A DSN parser


Version published
Weekly downloads
418
increased by17.09%
Maintainers
2
Created
Weekly downloads
 

Readme

Source

DSN Parser

Supports MySQL (mysql:) and Postgresql (pgsql:) schemes.

DSNs are a scheme, followed by semicolon (;), or, for command-line convenience, colon-separated (:) parameters in the form of key=value.

Valid parameters are host, port, dbname, user and password, and additionally username is accepted as a synonym for user.

All parameters are set as properties on the DSN object, except dbname is exposed as database.

Installation

npm install dsn

Usage

var parse = require('dsn').parse

var dsn = parse('mysql:host=db;dbname=myDBname')

/*
{ 
  protocol: 'mysql',
  host: 'db',
  database: 'myDBname'
} */

FAQs

Last updated on 14 Mar 2019

Did you know?

Socket

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc