🚀 DAY 5 OF LAUNCH WEEK: Introducing Socket Firewall Enterprise.Learn more →
Socket
Book a DemoInstallSign in
Socket

mongoose-dependent-seed

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mongoose-dependent-seed

latest
Source
npmnpm
Version
0.6.1
Version published
Maintainers
1
Created
Source

mongoose-dependent-seed :seedling:

BuildStatus code style: prettier semantic-release

Install

npm install mongoose-dependent-seed
yarn add mongoose-dependent-seed

Description

Mongoose database seeder - using your model dependency graph

Usage

seed.js

import Dependency from './dependency.model.js';

export default {
    dependencies: [Dependency],
    seed: deps => [
        {
            dependency,
            ...rest
        }
    ]
}

model.js

import createSeed from 'mongoose-dependent-seed';
import seed from './seed.js';

const Schema = new Schema({...});

export default createSeed('Model', Schema, seed);

app.js

import { seed } from 'mongoose-dependent-seed';

try {
    await seed();
    { ... }
} catch(error) { ... }

License

MIT © Sharon Grossman

FAQs

Package last updated on 24 Sep 2019

Did you know?

Socket

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.

Install

Related posts