🚀 DAY 5 OF LAUNCH WEEK:Introducing Webhook Events for Alert Changes.Learn more →
Socket
Book a DemoInstallSign in
Socket

httpplease-promises

Package Overview
Dependencies
Maintainers
2
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

httpplease-promises

A plugin that adds promise support to httpplease

latest
Source
npmnpm
Version
0.3.0
Version published
Maintainers
2
Created
Source

httpplease-promises

A plugin that adds promise support to httpplease.

Installation

node, browserify and webpack users:

npm install httpplease-promises

Bower users:

bower install httpplease-promises

Usage

var httpplease = require('httpplease'),
    promises = require('httpplease-promises'),
    http = httpplease.use(promises());

http
    .get('http://example.com')
    .then(function (res) {
        console.log(res.body); // or whatever.
    });

Alernatively, AMD users can use define and script tag users can use window.httppleasepromises.

By default, native Promises will be used. If you want to provide a different implementation (which may be necessary depending on the environments you want to support), pass it in:

var httpplease = require('httpplease'),
    promises = require('httpplease-promises'),
    Promise = require('bluebird'),
    http = httpplease.use(promises(Promise));

Keywords

xhr

FAQs

Package last updated on 19 Sep 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