http-reject-empty

1.0.0 • Public • Published

http-reject-empty Build Status Coverage Status

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

MIT © Noam Okman

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.0
    3
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.0.0
    3

Package Sidebar

Install

npm i http-reject-empty

Weekly Downloads

3

Version

1.0.0

License

MIT

Last publish

Collaborators

  • noamokman