antiboredom / servi.js

36 stars 6 forks source link

how to empty db? #11

Open lmccart opened 9 years ago

lmccart commented 9 years ago

I'm trying to do something like this: https://github.com/lmccart/itp-networked-media/blob/master/week6/09_create_db/server.js

of course, each time I run server.js again, it adds more to the db once it has been initially created. is there a command we could add like dropDB that would recreate the db, or is there something to test if it already exists so I don't repopulate it?

vanevery commented 9 years ago

That would certainly be helpful. One possibility is to check if the db file exists using the fs module but I agree that should be incorporated into servi.