No Description
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Zebulon McCorkle 3e2bcc12ba
Add README.md to package docs
11 months ago
debian Add README.md to package docs 11 months ago
test index: Add equality methods (equal, deepEqual, etc.) 4 years ago
.gitignore add coverage and badges 4 years ago
.travis.yml build: support io.js 3.x 2 years ago
HISTORY.md 1.3.0 2 years ago
LICENSE add coverage and badges 4 years ago
README.md docs: link to license 2 years ago
index.js index: Add equality methods (equal, deepEqual, etc.) 4 years ago
package.json 1.3.0 2 years ago

README.md

http-assert

NPM Version NPM Downloads Node.js Version Build Status Test Coverage

Assert with status codes. Like ctx.throw() in Koa, but with a guard.

Example

var assert = require('http-assert');
var ok = require('assert');

try {
  assert(username == 'fjodor', 401, 'authentication failed');
} catch (err) {
  ok(err.status == 401);
  ok(err.message == 'authentication failed');
  ok(err.expose);
}

Licence

MIT