jsdevel/node-express-crud — pull request #13 by Gooseus (2014-10-30 17:37:47+00:00)
Title: Changed interface and added format options

Hey man, this is actually the first time I've done a pull request and since I'm pretty sure this changes how you fundamentally use the module, so I doubt you'll accept it, but figured it's worth a shot.

I wanted to be able to pass my created express app in to the module in order to add the crud methods, rather than patching the express module, so I changed that interface.

Also, I needed a way to format the JSON data being sent back to the client, so I added an options object which is passed in with the app and can have a formatResponse method which has the response piped through it if it is present.

I added some more documentation to the README for these features and updated the tests to current tests to reflect the change, though I know I should add some more coverage for the formatResponse option.

I think formatting of the response data is a much needed feature and though the change in interface was more a preference thing, I can't think of a way to cleaner way to parametrize the module without giving it a function interface.

I feel this tool is pretty useful as is, but I'd like to help improve it without fragmenting if possible, let me know what you think on these points.

Thanks!