fakingoose 3.0.0 is a data mocking library for Mongoose schemas that automatically generates realistic mock data based on schema definitions. It supports Mongoose Schema and Model objects, offers per-field customization via options (static values, dynamic functions, type-specific generators like email or firstname), and handles nested schemas and arrays with size control. Unlike generic fakers, fakingoose integrates directly with Mongoose and respects schema types, enums, and constraints. Currently in active development with TypeScript support.
npm install fakingooseNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Creates a fakingoose factory from a Mongoose schema, customizes fields with email type, dynamic age, and fixed array size, then generates a single mock object.
Use `import { factory } from 'fakingoose'` instead of `import factory from 'fakingoose'`.Ensure your schema has `_id: true` or explicitly set `_id` value in options.
Use `populateWithFactory` and pass a factory instance.
Do not rely on a specific generation order; use `value` functions that depend on fields that are already set, or use `generate` with overrides.
Use `import { factory } from 'fakingoose'` or `const { factory } = require('fakingoose');`Run `npm install fakingoose` and ensure it's in dependencies.
Ensure the first argument to `factory()` is a `mongoose.Schema` instance or a `mongoose.Model`.