1.0.0 • Published 8 years ago
http-reject-empty v1.0.0
http-reject-empty
A function to reject empty values with an http exception
Install
$ npm install --save http-reject-empty
Usage
const empty = require('http-reject-empty');
const promise = User.find({}) // find a user in the db
.then(empty);
If the promise returns a falsy value, the promise is rejected with a 404 http error
License
1.0.0
8 years ago