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

popsicle-status

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

popsicle-status

Reject Popsicle responses on HTTP failure status codes

  • 1.0.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
55K
increased by42.95%
Maintainers
1
Weekly downloads
 
Created
Source

Popsicle Status

NPM version NPM downloads Build status Test coverage

Reject responses on HTTP failure status codes (404, 500, etc).

Installation

npm install popsicle-status --save

Usage

var request = require('popsicle')
var status = require('popsicle-status')

request('/users.json')
  .use(status())
  .catch(function (error) {
    console.log(error.type) //=> "EINVALIDSTATUS"
    console.log(error.message) //=> "Invalid HTTP status, 404, should be between 200 and 399"
    console.log(error.status) //=> 404
    console.log(error.popsicle) //=> Popsicle#Request
  })
  • status() Use default status codes (min: 200, max: 399)
  • status(number) Set the only valid HTTP status code
  • status(number, number) Set both the minimum and maximum HTTP status codes

TypeScript

Includes a type definition for TypeScript.

License

MIT

Keywords

FAQs

Package last updated on 01 Apr 2016

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