{"bugs":{"url":"https://github.com/serviejs/popsicle/issues"},"dist":{"shasum":"5384fc9db717e632f7e66d0bbc93d0f8b83a8f9b","tarball":"https://registry.npmjs.org/popsicle/-/popsicle-11.0.0-3.tgz","fileCount":31,"integrity":"sha512-L1TQuAKJ8QVmT36/QUrcGQajoPTZHZLqIhq1iyDd1wy4lk+/vhTQNIhtUmazvCfaxzbRKwLEMqzJqx73oJTz+w==","signatures":[{"sig":"MEUCIQC7obOAVx0cBh0cRQYU8hzOou6Et5/3cXOrAgHywdE9NAIgFEjMV5KalbBC74VH6VBavNsae25bHvURJ8KIW3CddKU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":154839,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbBpapCRA9TVsSAnZWagAAcaoP/iNA/NDR4l3zg3eFzu5Q\nESwM5ahjWhko4dROp8lNy321eZDDtK68oY/HQ5c3Wu4abVABWPY6X8UXJASr\nHS6F3wQe4/iGStnRMfghcHA2j5qeON9fXZTW3ndzzjWpy7DM52DZxCCOQclQ\nM9CLvjc7MjOEHuj/LWGguMhRb9Wr/EIAOdD9L+RZbQp1dvhLp2E0aOAwyBjK\n+R6HIVVcVpzyAqG2lOlr2xKBq7Y7umbdh6AI+ZY2GaBdHln1XZeDPvjozw3C\nHMFKo+yQWtd3MockhgDgevP8ws8gJv83jcTIAGvpWrfzCn50OydInj9zBxfa\nQWNsIJ7vT8mhMEov/Hju82Q5f/59HpSSAcevjbInx+6OsozHNDon+9q70Tq9\nJkl/PSy4HiTE/PNjp7pv4+f/fJeu7tqu2emNEq1cmE2wwyqC3P5dCj67e2S6\nv32GtHM1lHSby9xn4gSloosGbXm9xey9DizG3dGuWgFMt0/v083bCwRhVI1+\nNOpKt6klSv6k9QAx5MrD+kfO4YISXQB7bxpMHsE35Wv6TmMpffaxutF8WLaE\nwkmHGKW+ZudTL9ej/yB5Q/TwhZInztAeuLJN4jHwrd+wzFf42UwWdHVFEAud\nrPm514sOjisvcyjP7uNuPm/ulZDGOP4t42/iN2Ve3jND3SKA70XZSM4aIdWo\nFXHq\r\n=LSdh\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"roots":["<rootDir>/src/"],"testRegex":"(/__tests__/.*|\\.(test|spec))\\.(tsx?|jsx?)$","transform":{"\\.tsx?$":"ts-jest"},"moduleFileExtensions":["ts","tsx","js","jsx","json","node"]},"main":"dist/universal.js","name":"popsicle","files":["dist/","logo.svg"],"types":"dist/universal.d.ts","author":{"url":"http://blakeembrey.me","name":"Blake Embrey","email":"hello@blakeembrey.com"},"readme":"# ![Popsicle](https://cdn.rawgit.com/serviejs/popsicle/master/logo.svg)\n\n[![NPM version](https://img.shields.io/npm/v/popsicle.svg?style=flat)](https://npmjs.org/package/popsicle)\n[![NPM downloads](https://img.shields.io/npm/dm/popsicle.svg?style=flat)](https://npmjs.org/package/popsicle)\n[![Build status](https://img.shields.io/travis/serviejs/popsicle.svg?style=flat)](https://travis-ci.org/serviejs/popsicle)\n[![Test coverage](https://img.shields.io/coveralls/serviejs/popsicle.svg?style=flat)](https://coveralls.io/r/serviejs/popsicle?branch=master)\n[![Bundle size](https://img.shields.io/bundlephobia/minzip/popsicle.svg)](https://bundlephobia.com/result?p=popsicle)\n\n> Advanced HTTP requests in node.js and browsers, using [Servie](https://github.com/serviejs/servie).\n\n## Installation\n\n```\nnpm install popsicle --save\n```\n\n## Usage\n\n```js\nimport { transport, request } from 'popsicle'\n\nconst req = request('http://example.com') // Creates a `Request` instance.\nconst res = await transport()(req) // Transports `Request` and returns `Response` instance.\n```\n\nThin wrapper to transport [Servie](https://github.com/serviejs/servie) HTTP request interfaces.\n\n**P.S.** The default export from `popsicle` is `universal.js`. In TypeScript, this can cause trouble with types. Use specific imports such as `popsicle/dist/{browser,node,universal}` instead, depending on preference.\n\n### Node.js Normalization\n\nNormalizes some behavior that happens automatically in browsers (each normalization can be disabled).\n\n* Default `User-Agent` insertion\n* Default unzip behaviour of `gzip` and `deflate` encoding\n* Follows HTTP redirects\n\n### Built-in Transports\n\n#### HTTP (node.js)\n\n* **unzip: boolean** Automatically unzip response bodies (default: `true`)\n* **follow: boolean** Automatically follow HTTP redirects (default: `true`)\n* **jar: CookieJar** An instance of a cookie jar (`jar()` from `node.js` import)\n* **maxRedirects: number** Override the number of redirects allowed (default: `5`)\n* **confirmRedirect: Function** Validate `307` and `308` redirects (default: `() => false`)\n* **rejectUnauthorized: boolean** Reject invalid SSL certificates (default: `true`)\n* **agent: http.Agent** Custom `http.request` agent\n* **ca: string | Buffer** A string, `Buffer` or array of strings or `Buffers` of trusted certificates in PEM format\n* **key: string | Buffer** Private key to use for SSL\n* **cert: string | Buffer** Public x509 certificate to use\n* **secureProtocol: string** Optional SSL method to use\n\n#### XHR (browsers)\n\n* **type: XMLHttpRequestResponseType** Handle the XHR response (default: `text`)\n* **withCredentials: boolean** Send cookies with CORS requests (default: `false`)\n* **overrideMimeType: string** Override the XHR response MIME type\n\n#### Errors\n\nTransports can return an error. Errors have a `request` property set to the request object and a `code` string. The built-in codes are documented below:\n\n* **EUNAVAILABLE** Unable to connect to the remote URL\n* **EINVALID** Request URL is invalid (browsers)\n* **EMAXREDIRECTS** Maximum number of redirects exceeded (node.js)\n* **EBLOCKED** The request was blocked (HTTPS -> HTTP) (browsers)\n* **ECSP** Request violates the documents Content Security Policy (browsers)\n* **ETYPE** Invalid transport type (browsers)\n\n### Plugins\n\n_Coming back soon._\n\n### Helpful Utilities\n\n* [`throat`](https://github.com/ForbesLindesay/throat) - Throttle promise-based functions with concurrency support\n* [`is-browser`](https://github.com/ForbesLindesay/is-browser) - Check if your in a browser environment (E.g. Browserify, Webpack)\n* [`parse-link-header`](https://github.com/thlorenz/parse-link-header) - Handy for parsing HTTP link headers\n\n### Creating Plugins\n\nSee [Throwback](https://github.com/serviejs/throwback#usage) for more information:\n\n```ts\ntype Plugin = (req: Request, next: (req?: Request) => Promise<Response>) => Promise<Response>\n```\n\n### Transportation Layers\n\nSee [Servie](https://github.com/serviejs/servie#implementers) for more information:\n\n```ts\ntype Transport = (req: Request) => Promise<Response>\n```\n\n## TypeScript\n\nThis project is written using [TypeScript](https://github.com/Microsoft/TypeScript) and publishes the types to NPM alongside the package.\n\n## Related Projects\n\n* [Superagent](https://github.com/visionmedia/superagent) - HTTP requests for node and browsers\n* [Fetch](https://github.com/github/fetch) - Browser polyfill for promise-based HTTP requests\n* [Axios](https://github.com/mzabriskie/axios) - HTTP request API based on Angular's `$http` service\n\n## License\n\nMIT\n","browser":{"./dist/node.js":"./dist/browser.js"},"gitHead":"f2710cd997b1b60c100f12c191b924727155c70a","license":"MIT","scripts":{"lint":"tslint \"src/**/*.ts\" --project tsconfig.json","test":"npm run lint && npm run build && npm run server:open && npm run specs; EXIT=$?; npm run server:close; exit $EXIT","build":"rimraf dist/ && tsc && npm run bundle && npm run bundle:size","specs":"HTTPS_PORT=7358 PORT=7357 jest --coverage","bundle":"browserify -g [ envify --NODE_ENV production ] -s popsicle -o popsicle.js .","prepublish":"npm run build","bundle:size":"du -h popsicle.js","server:open":"PORT=7357 node scripts/http-server.js & echo $! > server.pid; HTTPS_PORT=7358 node scripts/https-server.js & echo $! > https-server.pid","server:close":"if [ -f server.pid ]; then kill -9 $(cat server.pid); rm server.pid; fi; if [ -f https-server.pid ]; then kill -9 $(cat https-server.pid); rm https-server.pid; fi"},"_npmUser":{"name":"blakeembrey","email":"hello@blakeembrey.com"},"homepage":"https://github.com/serviejs/popsicle","keywords":["request","http","middleware","node","ajax","browser","promise"],"repository":{"url":"git://github.com/serviejs/popsicle.git","type":"git"},"_npmVersion":"5.6.0","description":"Advanced HTTP requests in node.js and browsers, using Servie","directories":{},"maintainers":[{"name":"blakeembrey","email":"hello@blakeembrey.com"}],"_nodeVersion":"10.1.0","dependencies":{"pump":"^3.0.0","servie":"^3.2.3","throwback":"^3.0.0","@types/pump":"^1.0.1","tough-cookie":"^2.0.0","make-error-cause":"^2.1.0","@types/tough-cookie":"^2.3.2"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^22.4.4","envify":"^4.1.0","rimraf":"^2.6.2","tslint":"^5.10.0","express":"^4.16.3","methods":"^1.1.2","ts-jest":"^22.4.6","browserify":"^16.2.2","typescript":"^2.8.3","@types/jest":"^22.2.3","@types/node":"^10.1.2","body-parser":"^1.18.3","tslint-config-standard":"^7.0.0"},"_npmOperationalInternal":{"tmp":"tmp/popsicle_11.0.0-3_1527158441439_0.48968896631310055","host":"s3://npm-registry-packages"},"_id":"popsicle@11.0.0-3","version":"11.0.0-3"}