
Security News
The Hidden Blast Radius of the Axios Compromise
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.
@megaorm/seeder
Advanced tools
This package allows you to seed data into your database tables in MegaORM.
This package allows you to seed data into your database tables in MegaORM. Each seeder file corresponds to a specific table, allowing for targeted and efficient seeding and clearing. Let's explore how to create and use seeders!
To install this package, run the following command:
npm install @megaorm/seeder
You should be familiar with @megaorm/cli.
To create a seeder file, use the following command:
node mega add:seeder <table>
To create a seeder for the users table, run:
node mega add:seeder users
This command will output the following:
Seeder added in: ./seeders/01_seed_users_table.js
Below is an example of a seeder file for the users table:
const { MegaSeeder } = require('@megaorm/seeder');
class UsersTableSeeder extends MegaSeeder {
constructor() {
super();
this.set.rows(10); // Insert 10 rows
this.set.table('users'); // Target the 'users' table
}
layout() {
const faker = this.get.faker(); // Access a MegaFaker instance
return {
username: faker.username(), // Generate a random username
email: faker.email(), // Generate a random email
password: faker.password(), // Generate a random password
created_at: faker.datetime(), // Random datetime
updated_at: faker.datetime(), // Random datetime
};
}
}
module.exports = new UsersTableSeeder(); // Export a new instance
this.set.rows(number): Defines the number of rows to create (number must be > 0).this.set.table(name): Specifies the target table for seeding.this.get.faker(): Accesses MegaFaker instance to generate realistic, fake data for insertion.
layout method is executed the specified number of times to generate rows.layout method is called, it should return an object:
INSERT SQL query is built and executed.To seed all your tables, use:
node mega seed
To seed only one table, use:
node mega seed <table>
This command will seed the users table only:
node mega seed users
You can use this command to seed the same table multiple times!
To clear all tables with associated seeder files, use:
node mega clear
To clear only one table, use the following command:
node mega clear <table>
This command will clear all data from the users table only:
node mega clear users
To remove a specific seeder file, use the following command:
node mega remove:seeder <table>
For example, consider the following seeders folder structure:
- 01_seed_users_table.js
- 02_seed_profiles_table.js
If you execute:
node mega remove:seeder users
The users seeder file will be removed, and the numbering will update automatically:
- 01_seed_profiles_table.js
That's it! Managing your seeder files has never been easier.
FAQs
This package allows you to seed data into your database tables in MegaORM.
The npm package @megaorm/seeder receives a total of 0 weekly downloads. As such, @megaorm/seeder popularity was classified as not popular.
We found that @megaorm/seeder demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.

Research
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.

Research
Malicious versions of the Telnyx Python SDK on PyPI delivered credential-stealing malware via a multi-stage supply chain attack.