Comparing version 0.0.2 to 0.0.3
{ | ||
"name": "popsicle", | ||
"version": "0.0.2", | ||
"version": "0.0.3", | ||
"description": "Simple HTTP requests for node and the browser", | ||
@@ -5,0 +5,0 @@ "main": "popsicle.js", |
@@ -1,2 +0,2 @@ | ||
# Popsicle | ||
# ![Popsicle](https://cdn.rawgit.com/blakeembrey/popsicle/master/logo.svg) | ||
@@ -27,6 +27,10 @@ [![NPM version][npm-image]][npm-url] | ||
Then apply the polyfill (Browserify and node shown below). | ||
Apply the polyfill. | ||
```javascript | ||
// Node and browserify | ||
require('es6-promise').polyfill(); | ||
// Browsers | ||
window.ES6Promise.polyfill(); | ||
``` | ||
@@ -38,2 +42,3 @@ | ||
var request = require('popsicle'); | ||
// var request = window.popsicle; | ||
@@ -52,3 +57,2 @@ request({ | ||
.then(function (res) { | ||
console.log(res instanceof request.Response); //=> true | ||
console.log(res.status); // => 200 | ||
@@ -115,3 +119,3 @@ console.log(res.body); //=> { ... } | ||
req.catch(function (err) { | ||
console.log(err); //=> { message: 'Request aborted' } | ||
console.log(err); //=> { message: 'Request aborted', aborted: true } | ||
}); | ||
@@ -163,3 +167,3 @@ ``` | ||
// Things worked! | ||
// Success! | ||
}); | ||
@@ -198,6 +202,6 @@ ``` | ||
* **abort error** The request was aborted by user intervention (`err.abort`) | ||
* **timeout error* The request timed out (`err.timeout`) | ||
* **timeout error** The request timed out (`err.timeout`) | ||
* **unavailable error** Unable to connect to the remote URL (`err.unavailable`) | ||
* **blocked error** The request was blocked (HTTPS -> HTTP) (browsers, `err.blocked`) | ||
* **csp error** Request violates the documents Content Security Policy (browsers, `err.csp`) | ||
* **unavailable error** Unable to connect to the remote URL (`err.unavailable`) | ||
* **blocked error** The request was blocked - HTTPS -> HTTP (browsers, `err.blocked`) | ||
@@ -232,14 +236,8 @@ ### Plugins | ||
Install dependencies. | ||
Install dependencies and run the test runners (node and browsers using Karma). | ||
```bash | ||
npm install | ||
npm install && npm test | ||
``` | ||
Run the test runner, which automatically tests node and browsers using Karma. | ||
```bash | ||
npm test | ||
``` | ||
## License | ||
@@ -246,0 +244,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
57745
17
244