{"name":"superagent","version":"10.4.0","keywords":["agent","ajax","ajax","api","async","await","axios","cancel","client","frisbee","got","http","http","https","ky","promise","promise","promises","request","request","requests","response","rest","retry","super","superagent","timeout","transform","xhr","xmlhttprequest"],"author":{"name":"TJ Holowaychuk","email":"tj@vision-media.ca"},"license":"MIT","_id":"superagent@10.4.0","maintainers":[{"name":"niftylettuce","email":"niftylettuce@gmail.com"},{"name":"superjoe","email":"andrew@ziglang.org"},{"name":"rauchg","email":"rauchg@gmail.com"},{"name":"travisjeffery","email":"tj@travisjeffery.com"},{"name":"tjholowaychuk","email":"tj@vision-media.ca"},{"name":"kornel","email":"npmspam@geekhood.net"},{"name":"titanism","email":"npm@titanism.com"}],"contributors":[{"name":"Kornel Lesiński","email":"kornel@geekhood.net"},{"name":"Peter Lyons","email":"pete@peterlyons.com"},{"name":"Hunter Loftis","email":"hunter@hunterloftis.com"},{"name":"Nick Baugh","email":"niftylettuce@gmail.com"}],"homepage":"https://github.com/ladjs/superagent","bugs":{"url":"https://github.com/ladjs/superagent/issues"},"dist":{"shasum":"d32b3be7d22eced0e36ac9b1b7d8ddd7ba4c7b33","tarball":"http://registry-npm.ywwl.com/superagent/download/superagent-10.4.0.tgz","fileCount":21,"integrity":"sha512-QmE27Y9G7MvQR2B7S5q16IySUiZoNhhzxiU2YETs/NtfKrd5UaS5+yXzq4Doa4qDwQ36Wo6nQN3TW9Y7Wb4aew==","signatures":[{"sig":"MEUCIQDBSc75HWpXIxfoDzwPbhWRybj2bloDVfu2t50AcihQngIgV3JFLsIGWKeX7VPlpmE1zCo/tKHZCAkKNNP+k7g2SUY=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"sig":"MEQCIFLQRcwlwfMv2R5rcxlQhAsDF1trb2SySBK8T7/cgEiCAiBUVskc6liT7vIpmOYjCyqBqJyvJtvG7Z50V85J5xOtbw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":571261,"size":167285,"noattachment":false,"key":"/superagent/-/superagent-10.4.0.tgz"},"main":"lib/node/index.js","unpkg":"dist/superagent.min.js","browser":{"./lib/node/index.js":"./lib/client.js","./src/node/index.js":"./src/client.js","./test/support/server.js":"./test/support/blank.js"},"engines":{"node":">=14.18.0"},"gitHead":"23f05cec8d16b265a020b8ca758c32fb22c71233","scripts":{"nyc":"cross-env NODE_ENV=test nyc ava","lint":"eslint -c .eslintrc src test && remark . -qfo && eslint -c .lib.eslintrc lib/**/*.js && eslint -c .dist.eslintrc dist/**/*.js","test":"npm run build && npm run lint && make test","build":"npm run build:clean && npm run build:lib && npm run build:dist","minify":"cross-env NODE_ENV=production browserify src/node/index.js -o dist/superagent.min.js -s superagent -g [ babelify --configFile ./.dist.babelrc ] -p tinyify","prepare":"husky","coverage":"nyc report --reporter=text-lcov > coverage.lcov","build:lib":"babel --config-file ./.lib.babelrc src --out-dir lib","browserify":"browserify src/node/index.js -o dist/superagent.js -s superagent -g [ babelify --configFile ./.dist.babelrc ]","build:dist":"npm run browserify && npm run minify","build:test":"babel --config-file ./.test.babelrc test --out-dir lib/node/test","test-http2":"npm run build && npm run lint && make test-node-http2","build:clean":"rimraf lib dist"},"_npmUser":{"name":"titanism","email":"npm@titanism.com"},"jsdelivr":"dist/superagent.min.js","repository":{"url":"git://github.com/ladjs/superagent.git","type":"git"},"_npmVersion":"10.7.0","description":"elegant & feature rich browser / node HTTP with a fluent API","directories":{},"_nodeVersion":"18.20.4","dependencies":{"qs":"^6.14.1","mime":"2.6.0","debug":"^4.3.7","methods":"^1.1.2","cookiejar":"^2.1.4","form-data":"^4.0.5","formidable":"^3.5.4","component-emitter":"^1.3.1","fast-safe-stringify":"^2.1.1"},"_hasShrinkwrap":false,"devDependencies":{"xo":"^0.53.1","nyc":"^15.1.0","zuul":"^3.12.0","husky":"^9.1.7","mocha":"^6.2.3","Base64":"^1.1.0","eslint":"^8.32.0","marked":"^4.2.12","multer":"1.4.5-lts.1","rimraf":"3","should":"^13.2.3","express":"^4.18.3","fixpack":"^4.0.0","tinyify":"3.0.0","babelify":"^10.0.0","get-port":"4.2.0","cross-env":"^7.0.3","@babel/cli":"^7.20.7","browserify":"^17.0.0","remark-cli":"^11.0.0","@babel/core":"^7.20.12","body-parser":"^1.20.4","lint-staged":"^15.5.2","should-http":"^0.1.1","cookie-parser":"^1.4.7","@babel/runtime":"^7.20.13","@commitlint/cli":"^19.8.1","express-session":"^1.17.3","@babel/preset-env":"^7.20.2","basic-auth-connect":"^1.0.0","eslint-plugin-node":"^11.1.0","eslint-plugin-compat":"4.0.2","remark-preset-github":"4.0.4","eslint-config-xo-lass":"2","@babel/plugin-transform-runtime":"^7.19.6","@commitlint/config-conventional":"^19.8.1"},"_npmOperationalInternal":{"tmp":"tmp/superagent_10.4.0_1790095706049_0.38289381830775127","host":"s3://npm-registry-packages-npm-production"},"readme":"# superagent\n\n[![build status](https://github.com/forwardemail/superagent/actions/workflows/ci.yml/badge.svg)](https://github.com/forwardemail/superagent/actions/workflows/ci.yml)\n[![code coverage](https://img.shields.io/codecov/c/github/ladjs/superagent.svg)](https://codecov.io/gh/ladjs/superagent)\n[![code style](https://img.shields.io/badge/code_style-XO-5ed9c7.svg)](https://github.com/sindresorhus/xo)\n[![styled with prettier](https://img.shields.io/badge/styled_with-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![made with lass](https://img.shields.io/badge/made_with-lass-95CC28.svg)](https://lass.js.org)\n[![license](https://img.shields.io/github/license/ladjs/superagent.svg)](LICENSE)\n\n> Small progressive client-side HTTP request library, and Node.js module with the same API, supporting many high-level HTTP client features.  Maintained for [Forward Email](https://github.com/forwardemail) and [Lad](https://github.com/ladjs).\n\n\n## Table of Contents\n\n* [Install](#install)\n* [Usage](#usage)\n  * [Node](#node)\n  * [Browser](#browser)\n* [Supported Platforms](#supported-platforms)\n  * [Required Browser Features](#required-browser-features)\n* [Plugins](#plugins)\n* [Upgrading from previous versions](#upgrading-from-previous-versions)\n* [Contributors](#contributors)\n* [License](#license)\n\n\n## Install\n\n[npm][]:\n\n```sh\nnpm install superagent\n```\n\n[yarn][]:\n\n```sh\nyarn add superagent\n```\n\n\n## Usage\n\n### Node\n\n```js\nconst superagent = require('superagent');\n\n// callback\nsuperagent\n  .post('/api/pet')\n  .send({ name: 'Manny', species: 'cat' }) // sends a JSON post body\n  .set('X-API-Key', 'foobar')\n  .set('accept', 'json')\n  .end((err, res) => {\n    // Calling the end function will send the request\n  });\n\n// promise with then/catch\nsuperagent.post('/api/pet').then(console.log).catch(console.error);\n\n// promise with async/await\n(async () => {\n  try {\n    const res = await superagent.post('/api/pet');\n    console.log(res);\n  } catch (err) {\n    console.error(err);\n  }\n})();\n```\n\n### Browser\n\n**The browser-ready, minified version of `superagent` is only 50 KB (minified and gzipped).**\n\nBrowser-ready versions of this module are available via [jsdelivr][], [unpkg][], and also in the `node_modules/superagent/dist` folder in downloads of the `superagent` package.\n\n> Note that we also provide unminified versions with `.js` instead of `.min.js` file extensions.\n\n#### VanillaJS\n\nThis is the solution for you if you're just using `<script>` tags everywhere!\n\n```html\n<script src=\"https://cdnjs.cloudflare.com/polyfill/v3/polyfill.min.js?features=WeakRef,BigInt\"></script>\n<script src=\"https://cdn.jsdelivr.net/npm/superagent\"></script>\n<!-- if you wish to use unpkg.com instead: -->\n<!-- <script src=\"https://unpkg.com/superagent\"></script> -->\n<script type=\"text/javascript\">\n  (function() {\n    // superagent is exposed as `window.superagent`\n    // if you wish to use \"request\" instead please\n    // uncomment the following line of code:\n    // `window.request = superagent;`\n    superagent\n      .post('/api/pet')\n      .send({ name: 'Manny', species: 'cat' }) // sends a JSON post body\n      .set('X-API-Key', 'foobar')\n      .set('accept', 'json')\n      .end(function (err, res) {\n        // Calling the end function will send the request\n      });\n  })();\n</script>\n```\n\n#### Bundler\n\nIf you are using [browserify][], [webpack][], [rollup][], or another bundler, then you can follow the same usage as [Node](#node) above.\n\n\n## Supported Platforms\n\n* Node: v14.18.0+\n* Browsers (see [.browserslistrc](.browserslistrc)):\n\n  ```sh\n  npx browserslist\n  ```\n\n  ```sh\n  and_chr 102\n  and_ff 101\n  and_qq 10.4\n  and_uc 12.12\n  android 101\n  chrome 103\n  chrome 102\n  chrome 101\n  chrome 100\n  edge 103\n  edge 102\n  edge 101\n  firefox 101\n  firefox 100\n  firefox 91\n  ios_saf 15.5\n  ios_saf 15.4\n  ios_saf 15.2-15.3\n  ios_saf 15.0-15.1\n  ios_saf 14.5-14.8\n  ios_saf 14.0-14.4\n  ios_saf 12.2-12.5\n  kaios 2.5\n  op_mini all\n  op_mob 64\n  opera 86\n  opera 85\n  safari 15.5\n  safari 15.4\n  samsung 17.0\n  samsung 16.0\n  ```\n\n### Required Browser Features\n\nWe recommend using <https://cdnjs.cloudflare.com/polyfill/> (specifically with the bundle mentioned in [VanillaJS](#vanillajs) above):\n\n```html\n<script src=\"https://cdnjs.cloudflare.com/polyfill/v3/polyfill.min.js?features=WeakRef,BigInt\"></script>\n```\n\n* WeakRef is not supported in Opera 85, iOS Safari 12.2-12.5\n* BigInt is not supported in iOS Safari 12.2-12.5\n\n\n## Plugins\n\nSuperAgent is easily extended via plugins.\n\n```js\nconst nocache = require('superagent-no-cache');\nconst superagent = require('superagent');\nconst prefix = require('superagent-prefix')('/static');\n\nsuperagent\n  .get('/some-url')\n  .query({ action: 'edit', city: 'London' }) // query string\n  .use(prefix) // Prefixes *only* this request\n  .use(nocache) // Prevents caching of *only* this request\n  .end((err, res) => {\n    // Do something\n  });\n```\n\nExisting plugins:\n\n* [superagent-no-cache](https://github.com/johntron/superagent-no-cache) - prevents caching by including Cache-Control header\n* [superagent-prefix](https://github.com/johntron/superagent-prefix) - prefixes absolute URLs (useful in test environment)\n* [superagent-suffix](https://github.com/timneutkens1/superagent-suffix) - suffix URLs with a given path\n* [superagent-mock](https://github.com/M6Web/superagent-mock) - simulate HTTP calls by returning data fixtures based on the requested URL\n* [superagent-mocker](https://github.com/shuvalov-anton/superagent-mocker) — simulate REST API\n* [superagent-cache](https://github.com/jpodwys/superagent-cache) - A global SuperAgent patch with built-in, flexible caching\n* [superagent-cache-plugin](https://github.com/jpodwys/superagent-cache-plugin) - A SuperAgent plugin with built-in, flexible caching\n* [superagent-jsonapify](https://github.com/alex94puchades/superagent-jsonapify) - A lightweight [json-api](http://jsonapi.org/format/) client addon for superagent\n* [superagent-serializer](https://github.com/zzarcon/superagent-serializer) - Converts server payload into different cases\n* [superagent-httpbackend](https://www.npmjs.com/package/superagent-httpbackend) - stub out requests using AngularJS' $httpBackend syntax\n* [superagent-throttle](https://github.com/leviwheatcroft/superagent-throttle) - queues and intelligently throttles requests\n* [superagent-charset](https://github.com/magicdawn/superagent-charset) - add charset support for node's SuperAgent\n* [superagent-verbose-errors](https://github.com/jcoreio/superagent-verbose-errors) - include response body in error messages for failed requests\n* [superagent-declare](https://github.com/damoclark/superagent-declare) - A simple [declarative](https://en.wikipedia.org/wiki/Declarative_programming) API for SuperAgent\n* [superagent-node-http-timings](https://github.com/webuniverseio/superagent-node-http-timings) - measure http timings in node.js\n* [superagent-cheerio](https://github.com/mmmmmrob/superagent-cheerio) - add [cheerio](https://www.npmjs.com/package/cheerio) to your response content automatically. Adds `res.$` for HTML and XML response bodies.\n* [@certible/superagent-aws-sign](https://github.com/certible/superagent-aws-sign) - Sign AWS endpoint requests, it uses the aws4 to authenticate the SuperAgent requests\n\nPlease prefix your plugin with `superagent-*` so that it can easily be found by others.\n\nFor SuperAgent extensions such as couchdb and oauth visit the [wiki](https://github.com/ladjs/superagent/wiki).\n\n\n## Upgrading from previous versions\n\nPlease see [GitHub releases page](https://github.com/ladjs/superagent/releases) for the current changelog.\n\nOur breaking changes are mostly in rarely used functionality and from stricter error handling.\n\n* [6.0 to 6.1](https://github.com/ladjs/superagent/releases/tag/v6.1.0)\n  * Browser behaviour changed to match Node when serializing `application/x-www-form-urlencoded`, using `arrayFormat: 'indices'` semantics of `qs` library. (See: <https://www.npmjs.com/package/qs#stringifying>)\n* [5.x to 6.x](https://github.com/ladjs/superagent/releases/tag/v6.0.0):\n  * Retry behavior is still opt-in, however we now have a more fine-grained list of status codes and error codes that we retry against (see updated docs)\n  * A specific issue with Content-Type matching not being case-insensitive is fixed\n  * Set is now required for IE 9, see [Required Browser Features](#required-browser-features) for more insight\n* [4.x to 5.x](https://github.com/ladjs/superagent/releases/tag/v5.0.0):\n  * We've implemented the build setup of [Lass](https://lass.js.org) to simplify our stack and linting\n  * Unminified browserified build size has been reduced from 48KB to 20KB (via `tinyify` and the latest version of Babel using `@babel/preset-env` and `.browserslistrc`)\n  * Linting support has been added using `caniuse-lite` and `eslint-plugin-compat`\n  * We can now target what versions of Node we wish to support more easily using `.babelrc`\n* [3.x to 4.x](https://github.com/ladjs/superagent/releases/tag/v4.0.0-alpha.1):\n  * Ensure you're running Node 6 or later. We've dropped support for Node 4.\n  * We've started using ES6 and for compatibility with Internet Explorer you may need to use Babel.\n  * We suggest migrating from `.end()` callbacks to `.then()` or `await`.\n* [2.x to 3.x](https://github.com/ladjs/superagent/releases/tag/v3.0.0):\n  * Ensure you're running Node 4 or later. We've dropped support for Node 0.x.\n  * Test code that calls `.send()` multiple times. Invalid calls to `.send()` will now throw instead of sending garbage.\n* [1.x to 2.x](https://github.com/ladjs/superagent/releases/tag/v2.0.0):\n  * If you use `.parse()` in the *browser* version, rename it to `.serialize()`.\n  * If you rely on `undefined` in query-string values being sent literally as the text \"undefined\", switch to checking for missing value instead. `?key=undefined` is now `?key` (without a value).\n  * If you use `.then()` in Internet Explorer, ensure that you have a polyfill that adds a global `Promise` object.\n* 0.x to 1.x:\n  * Instead of 1-argument callback `.end(function(res){})` use `.then(res => {})`.\n\n\n## Contributors\n\n| Name                |\n| ------------------- |\n| **Kornel Lesiński** |\n| **Peter Lyons**     |\n| **Hunter Loftis**   |\n| **Nick Baugh**      |\n\n\n## License\n\n[MIT](LICENSE) © TJ Holowaychuk\n\n\n##\n\n[npm]: https://www.npmjs.com/\n\n[yarn]: https://yarnpkg.com/\n\n[jsdelivr]: https://www.jsdelivr.com/\n\n[unpkg]: https://unpkg.com/\n\n[browserify]: https://github.com/browserify/browserify\n\n[webpack]: https://github.com/webpack/webpack\n\n[rollup]: https://github.com/rollup/rollup\n","publish_time":1790095706143,"_cnpm_publish_time":1790095706143,"dist-tags":{"latest":"10.4.1","next":"4.1.0-beta.1"}}