db-seeder

1.4.0 • Public • Published

db-seeder

hello and welcome to this json db-seeder. Seed your databases from large JSON files automatically

how to use

npm i db-seeder

require the function in your file, pass in the seed data as the first argument and the url to your api as the second one.

this function will iterate over JSON arrays and post the content one by one to your api, all model handling must be done by your api, since this does not access your db directly

// your code here

const dbSeeder = require('db-seeder')

const seed = require('<path_to_your_seed_file>')

dbSeeder(seed, 'http://localhost:<port>/<add_items_one_by_one>')

// your code here

if you are testing your api and are hosting it locally then pass in the localhost link

contributing

don't really know what there is to contribute, but go ahead :)

Readme

Keywords

none

Package Sidebar

Install

npm i db-seeder

Weekly Downloads

0

Version

1.4.0

License

ISC

Unpacked Size

1.47 kB

Total Files

3

Last publish

Collaborators

  • nikhz