The `database-js-common` package provides essential utility functions designed to support the implementation of drivers within the broader `database-js` ecosystem. Its primary function is the robust parsing of database connection strings, converting complex URL-like formats (e.g., `key=value&nested[key]=value`) into structured JavaScript objects. It includes optional automatic type conversion for common values like booleans and numbers. Currently at version 1.0.1, this package serves as a foundational internal component for `database-js` drivers. However, it's crucial to note that the main `database-js` project itself, which this package supports, was last published in June 2021 (version 3.0.11). This indicates that the entire `database-js` ecosystem, including this common utility module, is likely in an abandoned or unmaintained state, with no active development, regular release cadence, or ongoing support. Its key differentiator is its specialized connection string parsing logic tailored for the `database-js` framework, rather than being a general-purpose, actively maintained parsing library.
npm install database-js-commonVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to use `parseConnectionParameters` to convert various connection string formats into structured JavaScript objects, including handling nested keys and optional type conversion. It also shows a basic integration into a mock database driver setup.
Consider migrating to a more actively maintained database abstraction layer or ORM for current and future projects. If retaining, be aware of potential vulnerabilities and compatibility issues, especially with newer Node.js releases.
Always use `const Common = require('database-js-common');` to import this package in both CJS and ESM environments (as ESM can import CJS default exports, albeit with some limitations).Ensure your environment correctly treats the file as CommonJS, or use dynamic `import()` if you must import a CJS module from an ESM file: `const Common = await import('database-js-common'); Common.default.parseConnectionParameters(...)`.Ensure you are calling it as `Common.parseConnectionParameters(...)` after assigning the `require` result to a variable like `Common`.
No dependency data recorded yet.