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

request-shim-for-callbacks

Package Overview
Dependencies
Maintainers
2
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

request-shim-for-callbacks

Wrap request's idiosyncratic callback format with a standard node-style callback

  • 1.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
2
Weekly downloads
 
Created
Source

request-shim-for-callbacks

Wrap request's idiosyncratic callback format with a standard Node-style callback.

Consider any status code not matching the expected status an error.

Usage

var request = require('request'),
    verifyResponseStatus = require('request-shim-for-callbacks');

request.get(
    {
        url: '/monitoring/raw',
        body: query,
    },
    verifyResponseStatus(200, function (err, data) {
        if (err) {
            callback(err, null);
        } else {
            console.log(data);

            callback(null, data);
        }
    })
);

Contribute

  • Issue Tracker: github.com/bodylabs/request-shim-for-callback/issues
  • Source Code: github.com/bodylabs/request-shim-for-callbacks

Pull requests welcome!

License

The project is licensed under the two-clause BSD license.

FAQs

Package last updated on 25 Feb 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