I have mixed feelings about ORMs, and prefer to err on the side of the more lightweight solution when I’m not sure which tool will be most appropriate to the problem I’m trying to solve. I recently found myself re-inventing the CRUD wheel once again for a node app I’m writing, and tried to find a library with a little more abstraction than the basic MySQL library without going full ORM – but turned up nothing that was appealing.
Over the last few months I’ve really embraced the promises pattern in my JavaScript, and I wanted something that would let me execute SQL queries asynchronously with promises. I also wanted something that would be DRY for the REST API’s I’m often writing.
I have to say that I’m pretty happy with the result. I’ve been using the Q Promise Library, but I’ve heard good things about some other libraries so I wrote this to support a range of promise libraries so that you can use your preferred library natively with this library. Its methods return promises so they can be easily chained with other promises. The library exposes methods which correspond to HTTP methods for GET, POST, PUT and DELETE so that you can spend more time on your app instead of writing yet another set of CRUD methods.
You can find the docs on the project’s github page. I’d appreciate all constructive feedback whether it is positive or negative.