mongodb-connection-string-url
MongoDB connection strings, based on the WhatWG URL API
Last updated 11 days ago by GitHub Actions .
Apache-2.0 · Repository · Bugs · Original npm · Tarball · package.json
$ npm install mongodb-connection-string-url 
SYNC missed versions from official npm registry.

mongodb-connection-string-url

MongoDB connection strings, based on the WhatWG URL API

import ConnectionString from 'mongodb-connection-string-url';

const cs = new ConnectionString('mongodb://localhost');
cs.searchParams.set('readPreference', 'secondary');
console.log(cs.href); // 'mongodb://localhost/?readPreference=secondary'

Deviations from the WhatWG URL package

  • URL parameters are case-insensitive
  • The .host, .hostname and .port properties cannot be set, and reading them does not return meaningful results (and are typed as neverin TypeScript)
  • The .hosts property contains a list of all hosts in the connection string
  • The .href property cannot be set, only read
  • There is an additional .isSRV property, set to true for mongodb+srv://
  • There is an additional .clone() utility method on the prototype

AI Agent Configuration

This repository uses agentskills.io conventions for AI coding agent instructions. AGENTS.md is the canonical source of truth — tool-specific files like CLAUDE.md are generated references.

Adding a nested AGENTS.md

  1. Create an AGENTS.md in the target directory.
  2. git add the file.
  3. Run scripts/symlink-claude-md.sh to generate the companion CLAUDE.md.
    • Note: scripts/symlink-claude-md.sh is vendored from an internal repo and should not be edited directly.
  4. Stage and commit the files.

LICENSE

Apache-2.0

Current Tags

  • 4.0.0-alpha                                ...           alpha (a year ago)
  • 7.0.3                                ...           latest (11 days ago)

29 Versions

  • 7.0.3                                ...           11 days ago
  • 7.0.2                                ...           4 months ago
  • 7.0.1                                ...           10 months ago
  • 7.0.0                                ...           a year ago
  • 4.0.0-alpha                                ...           a year ago
  • 3.0.2                                ...           2 years ago
  • 3.0.1                                ...           3 years ago
  • 3.0.0                                ...           3 years ago
  • 2.6.0                                ...           4 years ago
  • 2.5.4                                ...           4 years ago
  • 2.5.3                                ...           4 years ago
  • 2.5.2                                ...           5 years ago
  • 2.5.1                                ...           5 years ago
  • 2.5.0                                ...           5 years ago
  • 2.4.2                                ...           5 years ago
  • 2.4.1                                ...           5 years ago
  • 2.4.0                                ...           5 years ago
  • 2.3.2                                ...           5 years ago
  • 2.3.1                                ...           5 years ago
  • 2.3.0                                ...           5 years ago
  • 2.2.0                                ...           5 years ago
  • 2.1.0                                ...           5 years ago
  • 2.0.0                                ...           5 years ago
  • 1.1.2                                ...           5 years ago
  • 1.1.1                                ...           5 years ago
  • 1.1.0                                ...           5 years ago
  • 1.0.2                                ...           5 years ago
  • 1.0.1                                ...           5 years ago
  • 1.0.0                                ...           5 years ago
Downloads
Total 23
Today 0
This Week 2
This Month 2
Last Day 1
Last Week 0
Last Month 3
Dependencies (2)
Dev Dependencies (18)
Dependents (1)

© 2010 - cnpmjs.org x YWFE | Home | YWFE