Registry / testing / mongodb-crypt-library-dummy

mongodb-crypt-library-dummy

JSON →
library1.0.2jsnpmunverified

Dummy implementation of a MongoDB Crypt shared library for testing and development. Version 1.0.2 (stable). This package provides only version helper functions without actual crypto operations. It mimics the interface of the real mongodb-crypt-library for use in unit tests or environments where the native library is not available. Release cadence is low; typically updated alongside the real library. Key differentiator: allows testing of @mongodb-js/mongodb-client-encryption without requiring the native dependency.

npm install mongodb-crypt-library-dummy
INSTALL
IMPORT
SIG · MONGODB-CRYPT-LIBR
M
mongodb-crypt-library-dummy
testingjavascriptv1.0.2
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

dummyMongoCryptVersion
import { dummyMongoCryptVersion } from 'mongodb-crypt-library-dummy'
const { dummyMongoCryptVersion } = require('mongodb-crypt-library-dummy')
Package is ESM-only. Use static import.
getVersion
import { getVersion } from 'mongodb-crypt-library-dummy'
const getVersion = require('mongodb-crypt-library-dummy').getVersion
Named export, not default.
MongoCryptDummy
import { MongoCryptDummy } from 'mongodb-crypt-library-dummy'
import MongoCryptDummy from 'mongodb-crypt-library-dummy'
Default import is not available; use named import.

Shows how to import and use version helpers from the dummy library. This is used for testing without native dependencies.

import { dummyMongoCryptVersion, v8LoaderErrorOverrides, getVersion } from 'mongodb-crypt-library-dummy'; // Log the version strings console.log('Dummy version:', dummyMongoCryptVersion); console.log('Version:', getVersion()); // Example of using v8LoaderErrorOverrides to test error handling with a mock const overrides = v8LoaderErrorOverrides; if (overrides.length > 0) { console.log('Override functions available:', overrides.length); } // Outputs: // Dummy version: 1.0.2 // Version: 1.0.2 // Override functions available: 0
Debug
Known issues
gotchaThis package does not perform actual cryptographic operations; it only exposes version helpers. Do not use in production.
fix
Use the full mongodb-client-encryption package for production.
affects: >=1.0.0
gotchaThe package name 'mongodb-crypt-library-dummy' may be confused with the actual native library. Ensure correct installation.
fix
Install 'mongodb-crypt-library-dummy' only for testing; use 'mongodb-crypt-library' for production.
affects: >=1.0.0
Errors
Common errors & fixes
Cannot find module 'mongodb-crypt-library-dummy' or its corresponding type declarations.
Package not installed or missing from node_modules.
fix
Run 'npm install mongodb-crypt-library-dummy --save-dev'
ERR_REQUIRE_ESM: require() of ES Module not supported.
This package is ESM-only and cannot be used with require() in a CommonJS context.
fix
Use import syntax or dynamic import().
Upgrade
Version history
1.0.2latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
10 hits · last 30 days
node
8
Amazon
1
Resources
mongodb-crypt-library-dummy — npm install mongodb-crypt-library-dummy · libregistry