object-refs is a minimalist JavaScript library designed to establish and manage bi-directional references between objects. It's particularly useful in scenarios where maintaining explicit links between related objects, where one object's reference to another implies a reciprocal reference, is critical for data integrity or graph-like structures. The current stable version is 0.4.0. Given its `0.x.x` versioning, it likely follows an agile release cadence, introducing features and potentially breaking changes in minor versions. Its key differentiator is its focus on being minimal and providing robust type definitions for TypeScript users since `v0.4.0`, enabling safer refactoring and development compared to manual reference management.
npm install object-refsVerified import paths — ran on the pinned version, not inferred.
Demonstrates how to create a `Refs` instance, define reference properties, and establish/remove bi-directional links between two objects.
Always review the `CHANGELOG.md` file or release notes when upgrading `object-refs` to any new `0.x.x` version to identify potential breaking changes in API surface or behavior.
Ensure `object-refs` is at least `v0.4.0`. Remove any `@types/object-refs` dependency if present, as the types are now bundled with the package directly. Verify `tsconfig.json` paths and `typeRoots` are correctly configured if issues persist.
If encountering module resolution errors, explicitly configure your bundler (e.g., Webpack, Rollup) or Node.js environment to prefer ESM or CJS as needed, or ensure your `package.json`'s `type` field and import statements are consistent with the module system being used.
Change the import statement to use named destructuring: `import { Refs } from 'object-refs';`Ensure `Refs` is properly destructured from the CommonJS `require`: `const { Refs } = require('object-refs');`No dependency data recorded yet.