Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

hoek-boom

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hoek-boom

Extending node utilities shared amongst the extended hapi universe with some boom sprinkles

  • 1.0.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2
decreased by-66.67%
Maintainers
1
Weekly downloads
 
Created
Source

hoek-boom Build Status Dependency Status devDependency Status

hoek Logo

boom Logo

+ a few additions

Introduction

This library extends and exposes Hoek and also exposes Boom.

Additional Features

On top of the already exposed Hoek module API.

assertBoom( condition, message, errorName )

var a = 1, b = 2;

HoekBoom.assertBoom(a === b, 'a should equal b', 'expectationFailed');  // ABORT: a should equal b, throw boom error

// other uses ...
HoekBoom.assertBoom(); // throws Error
HoekBoom.assertBoom(a === b); // throws Error
HoekBoom.assertBoom(a === b, new Error('example')); // throws given error object
HoekBoom.assertBoom(a === b, 'badRequest'); // throws Boom.badRequest()
HoekBoom.assertBoom(a === b, 'some message'); // throws Error('some message')
HoekBoom.assertBoom(a === b, 'some', 'message', new Error('here'), 'for all', {test: 'lolz'});  // throws Error('some message here for all ' + JSON.stringify({test: 'lolz'}))
HoekBoom.assertBoom(a === b, 'some', 'message'); // throws Error('some message')
HoekBoom.assertBoom(a === b, 'check the docs', 'badRequest'); // throws Boom.badRequest('check the docs')
HoekBoom.assertBoom(a === b, 'check the docs', {username: 'johnsmith'}, 'badRequest'); // throws Boom.badRequest('check the docs', {username: 'johnsmith'})
HoekBoom.assertBoom(a === b, 'invalid password', 'sample', {username: 'johnsmith'}, 'unauthorized'); // throws Boom.unauthorized('invalid password', 'sample', {username: 'johnsmith'})

Boom

var Boom = HoekBoom.Boom;

reply(Boom.notFound('stuff wasn\'t found here'));

Keywords

FAQs

Package last updated on 20 Dec 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc