mongoose-throw-if-not-found-plugin
Don't check for nulls when running your Mongoose 5 queries - let rejected promises do it for you.
Before:
MyModel ;
After:
MyModel
Usage
Simply import the library once anywhere in your code:
;
It'll handle itself from there ;)
TypeScript usage
While typings are provided, sometimes your IDE may fail to recognise them for code hints. If this happens, simply add the import to the file you're using it from:
;