resolve-mongodb-srv
TypeScript icon, indicating that this package has built-in type declarations

1.1.5 • Public • Published

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

/resolve-mongodb-srv/

    Package Sidebar

    Install

    npm i resolve-mongodb-srv

    Weekly Downloads

    20,639

    Version

    1.1.5

    License

    Apache-2.0

    Unpacked Size

    25 kB

    Total Files

    11

    Last publish

    Collaborators

    • orechova
    • himanshusinghs
    • c-buckingham
    • mongo-j
    • mabaasit
    • alexander_schroll
    • chuck.kalmanek
    • mongodb-js-user
    • rueckstiess
    • durran
    • lerouxb
    • fredtruman
    • mbroadst
    • hswolff
    • satyasinha
    • matt_d_rat
    • rhysm
    • tomhollander
    • alena.khineika
    • jeff-allen-mongo
    • mmarcon
    • jonathan.balsano
    • mongodb-build
    • jack.weir
    • stennie
    • mcasimir
    • kristina.stefano
    • jarjee
    • shaketbaby
    • devtoolsbot
    • addaleax
    • gribnoysup
    • mutukrish