Nestjs Seeder

screenshot of Nestjs Seeder
nestjs

An extension library for NestJS to perform seeding.

Overview

NestJS Seeder is a versatile library designed for efficient database seeding in NestJS applications, regardless of the database type used. This makes it a powerful tool for developers looking to streamline their data insertion processes. The library offers a user-friendly interface that allows you to easily define models and seeders, making it ideal for both novice and experienced developers.

With its flexibility and ease of integration, NestJS Seeder significantly simplifies the process of populating databases with initial data. Whether you need static values, randomly generated data, or custom function outputs, this library has you covered. By following a straightforward series of steps, you can enhance your projects with robust seeding capabilities.

Features

  • Database Agnostic: Works with any database type, allowing you to define your model classes without restrictions.

  • Easy Installation: Simple setup process via npm, making it a breeze to incorporate into your NestJS projects.

  • @Factory Decorator: Supports various argument types for dynamic property values during seeding, including static values, Faker-generated values, and custom functions.

  • Seeder Interface: Implement the essential seed() and drop() methods in your seeder class to manage data insertion and clearance effortlessly.

  • Nested Dependency Injection: Seamlessly integrate with NestJS's dependency injection system to leverage existing services and modules within your seeder.

  • Flexible Command Line Integration: Add custom scripts to your package.json for running seeders normally or refreshing existing data, enhancing ease of use.

  • Predefined Value Access: Access and fill context with predefined values from previous seeding operations, making it easier to manage complex data relationships.

  • Open Source License: Utilizes an MIT license, ensuring that developers can freely use and modify the library as per their needs.

nestjs
Nest

A progressive Node.js framework for building efficient, scalable, and enterprise-grade server-side applications with TypeScript/JavaScript.

typescript
Typescript

TypeScript is a superset of JavaScript, providing optional static typing, classes, interfaces, and other features that help developers write more maintainable and scalable code. TypeScript's static typing system can catch errors at compile-time, making it easier to build and maintain large applications.