🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Sign inDemoInstall
Socket

resolve-mongodb-srv

Package Overview
Dependencies
Maintainers
33
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

resolve-mongodb-srv

Resolve mongodb+srv:// URLs to mongodb:// URLs

1.1.5
latest
Source
npm
Version published
Weekly downloads
32K
-42.58%
Maintainers
33
Weekly downloads
 
Created
Source

resolve-mongodb-srv

Resolve mongodb+srv:// URLs to mongodb:// URLs as specified in the Initial DNS Seedlist Discovery Specification.

import resolveMongodbSrv from 'resolve-mongodb-srv';

await resolveMongodbSrv('mongodb+srv://user:password@somecluster.mongodb.net/db');
// Returns: mongodb://user:password@host1,host2,host3/db

The resolveMongodbSrv function takes an optional second argument, where the used dns implementation can be passed in:

import dns from 'dns';
import resolveMongodbSrv from 'resolve-mongodb-srv';

await resolveMongodbSrv('hostname', { dns });

LICENSE

Apache-2.0

Keywords

mongodb

FAQs

Package last updated on 10 May 2024

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