Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Socket
Sign inDemoInstall

dsn

Package Overview
Dependencies
Maintainers
2
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dsn

A DSN parser


Version published
Weekly downloads
450
increased by21.95%
Maintainers
2
Weekly downloads
 
Created
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

Package 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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc