Skip to content

taoyuan/slu-seed

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

slu-seed NPM version Build Status Dependency Status Coverage percentage

Database seed module for loopback applications.

Installation

> npm i slu-seed --save

Usage

1. added to component-config.json

...
"slu-seed": {}
...

2. put sample data to ./server/db/seeds/{env}/{any_name}.js.

For example:

// ./server/db/seeds/development/users.js
User.seed({
    "username": "bob",
    "password": "secret",
    "email": "foo@bar.com"
});

3. seed data

  • seed data using slu command line. Before this, you should install slu first.
> slu seed
  • or seed data in program.
...
// server/boot/seeds.js
module.exports = function (app, cb) {
  app.seed(cb);
}
...

4. create seeds using data stored in database

> slu seed harvest

License

MIT © Tao Yuan

About

Database seed module for loopback applications.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published