MongoDB ObjectID utilities library, version 3.2.1. Provides creation, validation, casting, and comparison of MongoDB ObjectIDs. Lightweight and focused on compatibility with the native MongoDB driver (npm `mongodb`). Supports both Node.js and browser environments with distinct major versions. Static methods like `isValid`, `tryParse`, and `equals` complement instance methods. Released under MIT license.
npm install objectidNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows creation, validation, casting, and equality checking of MongoDB ObjectIDs.
Use 1.x for browser environments, or ensure compatibility with mongodb driver.
If you need strict ObjectID instance check, use instanceof or driver-specific method.
Use objectid.isValid() before calling objectid(arg).
Use import objectid from 'objectid' instead of import { objectid } from 'objectid'.First validate with objectid.isValid() before passing to objectid().
Use import objectid from 'objectid' instead of const objectid = require('objectid').No dependency data recorded yet.