scottwrobinson / camo

A class-based ES6 ODM for Mongo-like databases.
556 stars 80 forks source link

remove dependency to "fs" module #76

Open jampy opened 8 years ago

jampy commented 8 years ago

The README states:

This also allows you to use Camo in the browser, since databases like NeDB supports in-memory storage.

However, nedbclient.js relies on the fs module, making a browser build impossible.

As far as I can tell this is only needed for dropDatabase() - but I guess that should be competence of NeDB itself and Camo should not mess with NeDB's storage backend at all..

PS: Camo looks very interesting, good job so far! I really hope development remains active and a stable version can be reached soon so that we can use it in production

scottwrobinson commented 8 years ago

Thanks, @jampy, I'd like keep up with development on Camo, but it's a bit tough to stay on top of issues. Always looking for extra help if anyone is interested 😉.

Yep, you're right, Camo needs some work before it can run in a browser. The README needs to be updated to reflect that. I think we can safely get rid of the dependency on fs and just use deleteMany() to remove all data in the collection instead of deleting the file. Can't remember if there was a reason I didn't do that in the first place. I'll have to look in to it.

Thanks!