1.0.1 • Published 8 months ago

mstdog v1.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
8 months ago

Mongoose Schema to Dummy Object Generator

Generate realistic mock data for your Mongoose schemas with ease.


Description

mstdog is a simple and efficient tool to generate mock data based on your Mongoose schemas. It supports various field types, embedded subdocuments, arrays, and more. Integrated with the faker library, it ensures that you get realistic mock data for each field type.

Installation

Install the package using npm:

npm install mstdog --save-dev

Usage

import mstdog from 'mstdog';

const yourSchema = new Schema({
    name: String,
    age: Number,
    isActive: Boolean,
    birthdate: Date
});

const mockData = mstdog(yourSchema.paths);
console.log(mockData);

Supported Field Types

  • String ( supports enum )
  • Number
  • Date
  • Boolean
  • ObjectId
  • Mixed
  • Embedded subdocuments
  • Arrays of basic types and subdocuments ( supports enum )

Contributing

Feedback, bug reports, and pull requests are welcome. Feel free to improve and suggest any changes.

License

MIT


1.0.1

8 months ago

1.0.0

8 months ago

0.0.3

8 months ago

0.0.2

8 months ago

0.0.1

8 months ago