chensenlai 10988628a0 语音房项目初始化 5 years ago
..
node_modules 10988628a0 语音房项目初始化 5 years ago
HISTORY.md 10988628a0 语音房项目初始化 5 years ago
LICENSE 10988628a0 语音房项目初始化 5 years ago
index.js 10988628a0 语音房项目初始化 5 years ago
package.json 10988628a0 语音房项目初始化 5 years ago
readme.md 10988628a0 语音房项目初始化 5 years ago

readme.md

#http-assert

NPM version Build status Test coverage Dependency Status License Downloads

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