seald / nedb

The JavaScript Database, for Node.js, nw.js, electron and the browser

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add notice about nedb-promises

RollingHog opened this issue · comments

@RollingHog What kind of notice are you thinking about ?

commented

done in #11

where exactly its done there?

commented

In this commit: df358b9, it is not merged yet though.

Aha, I see, many thanks. Will close issue as soon as it will be merged.

BTW, the PR in question will kinda make nedb-promises redundant.

commented

Indeed, as you can see in the branch https://github.com/seald/nedb/tree/remove-async and in the beta version of @seald-io/nedb (v3), we removed the async dependency which is very outdated replaced it by using Promises, once we were there, we decided to expose a Promise-based interface. The callback-based interface of this new version is actually the Promise-based interface callbackified.

I would recommend you test the v3 before we release it to make sure nedb-promises works properly with it. @RollingHog

If you make your own Promise interface I'm not even sure nedb-promises is needed anymore.

commented

I agree with you that nedb-promises will probably not be needed anymore with that new interface of @seald-io/nedb@3.x.x.

However some of the users of nedb-promises may not want to change their code, but may want to upgrade to the latest version of @seald-io/nedb.
This new version we are releasing does expose a Promise-based interface, but it is not a drop-in replacement for nedb-promises. I didn't want to have hybrid function that test the type of the last argument to determine whether to work with a callback or return a Promise...

Therefore the Promise interface of @seald-io/nedb v3 is another set of functions: for every function that works with a callback, there is an equivalent function suffixed with Async.

commented

released in v3.0.0