{"_id":"@adaskothebeast/http-params-processor-axios","_rev":"4-33d13d006b7d1408fcfd1ce3fb141b5e","name":"@adaskothebeast/http-params-processor-axios","dist-tags":{"latest":"12.0.0"},"versions":{"10.0.0":{"name":"@adaskothebeast/http-params-processor-axios","version":"10.0.0","keywords":["axios","params","query","url","http","serialization","typescript","paramsSerializer"],"author":{"name":"Adam Pluciński","email":"adaskothebeast@gmail.com"},"license":"MIT","_id":"@adaskothebeast/http-params-processor-axios@10.0.0","maintainers":[{"name":"adasko","email":"adaskothebeast@gmail.com"}],"homepage":"https://github.com/AdaskoTheBeAsT/HttpParamsProcessor","bugs":{"url":"https://github.com/AdaskoTheBeAsT/HttpParamsProcessor/issues"},"dist":{"shasum":"15647c68dc9bce061a83a06408d7155275abbd7e","tarball":"https://registry.npmjs.org/@adaskothebeast/http-params-processor-axios/-/http-params-processor-axios-10.0.0.tgz","fileCount":11,"integrity":"sha512-2aBbnQdOQzAZVfywC8NQ/JEZVQ7OOhZPoc6TjQi7sKVU7VU/uwWN1kUo3rTblAlQGxOgXt6coGtVIZQV/hjhyA==","signatures":[{"sig":"MEUCIQDpc6z56vp0apNOS8tDQYLDNNDNNIxGW64ifHGz93tzcwIgdSusrbzVSPkTMNjKOZYOukjAPbGOW4yBbAV8cnz3cYQ=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":40113},"main":"./src/index.js","type":"commonjs","types":"./src/index.d.ts","module":"./src/index.js","exports":{".":{"types":"./src/index.d.ts","import":"./src/index.js","require":"./src/index.js"}},"gitHead":"1e61d6323f67038b9af916e4f3d263a73fe76497","_npmUser":{"name":"adasko","email":"adaskothebeast@gmail.com"},"repository":{"url":"git+https://github.com/AdaskoTheBeAsT/HttpParamsProcessor.git","type":"git"},"_npmVersion":"11.6.2","description":"Axios adapter for params-processor - serialize complex objects to query parameters","directories":{},"sideEffects":false,"_nodeVersion":"24.12.0","_hasShrinkwrap":false,"peerDependencies":{"axios":"^1.0.0","@adaskothebeast/http-params-processor-core":"^10.0.0"},"peerDependenciesMeta":{"axios":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/http-params-processor-axios_10.0.0_1768076998501_0.9057088800137574","host":"s3://npm-registry-packages-npm-production"}},"11.0.0":{"name":"@adaskothebeast/http-params-processor-axios","version":"11.0.0","author":{"url":"https://github.com/adaskothebeast","name":"Adam Pluciński","email":"adaskothebeast@gmail.com"},"license":"MIT","_id":"@adaskothebeast/http-params-processor-axios@11.0.0","maintainers":[{"name":"adasko","email":"adaskothebeast@gmail.com"}],"homepage":"https://github.com/AdaskoTheBeAsT/HttpParamsProcessor","bugs":{"url":"https://github.com/AdaskoTheBeAsT/HttpParamsProcessor/issues"},"dist":{"shasum":"3955707a66c0eb051d5c8b218c8d632d4d55d669","tarball":"https://registry.npmjs.org/@adaskothebeast/http-params-processor-axios/-/http-params-processor-axios-11.0.0.tgz","fileCount":8,"integrity":"sha512-l9Oc9DD72TxeXlnykj57/mD0EneNcEIZGuVA6MN355Ru79yG1L7PUvU/8U/gbexN7/LRbSQHbF79rvMm6JGadw==","signatures":[{"sig":"MEQCIHRKZRq+1CmFia5dejQR4QYwDYF45V6Bs9L11H7V2qTcAiB48bilKpAIqZ+oVXNxM6Go8MwnQ/Xj71fOw1Vc9dnEAA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@adaskothebeast%2fhttp-params-processor-axios@11.0.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":51585},"main":"./index.cjs","type":"module","types":"./index.d.ts","module":"./index.js","exports":{".":{"types":"./index.d.ts","import":"./index.js","default":"./index.js","require":"./index.cjs"},"./package.json":"./package.json"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:2d59e3d5-90b7-40da-aeb4-7b3620a6af4e"}},"repository":{"url":"git+https://github.com/AdaskoTheBeAsT/HttpParamsProcessor.git","type":"git"},"_npmVersion":"11.6.2","directories":{},"_nodeVersion":"24.12.0","_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/http-params-processor-axios_11.0.0_1768758176010_0.27229335311842773","host":"s3://npm-registry-packages-npm-production"}},"11.1.0":{"name":"@adaskothebeast/http-params-processor-axios","version":"11.1.0","author":{"url":"https://github.com/adaskothebeast","name":"Adam Pluciński","email":"adaskothebeast@gmail.com"},"license":"MIT","_id":"@adaskothebeast/http-params-processor-axios@11.1.0","maintainers":[{"name":"adasko","email":"adaskothebeast@gmail.com"}],"homepage":"https://github.com/AdaskoTheBeAsT/HttpParamsProcessor","bugs":{"url":"https://github.com/AdaskoTheBeAsT/HttpParamsProcessor/issues"},"dist":{"shasum":"11178c9e4e6e66aa78f2600a99c08f99c891347f","tarball":"https://registry.npmjs.org/@adaskothebeast/http-params-processor-axios/-/http-params-processor-axios-11.1.0.tgz","fileCount":8,"integrity":"sha512-jUpzleRxySrxZsEXHX+b0Pz3BrI4kzdW/aaElzXqdEXGe8kX6vaCEeHzqSvsBDN3FZqFPD/rXNh3GEyRICh6wA==","signatures":[{"sig":"MEUCIQCYbehXrY/wFLssrujCil3fYPegOrM7AMfJK/laQb6X1AIgIvdscS/VRpKgCASXFFT4gmQIwBc5TYvYf7x4GmeyIcs=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@adaskothebeast%2fhttp-params-processor-axios@11.1.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":51585},"main":"./index.cjs","type":"module","types":"./index.d.ts","module":"./index.js","exports":{".":{"types":"./index.d.ts","import":"./index.js","default":"./index.js","require":"./index.cjs"},"./package.json":"./package.json"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:2d59e3d5-90b7-40da-aeb4-7b3620a6af4e"}},"repository":{"url":"git+https://github.com/AdaskoTheBeAsT/HttpParamsProcessor.git","type":"git"},"_npmVersion":"11.6.2","directories":{},"_nodeVersion":"24.12.0","_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/http-params-processor-axios_11.1.0_1768758916811_0.9015395188935214","host":"s3://npm-registry-packages-npm-production"}},"12.0.0":{"name":"@adaskothebeast/http-params-processor-axios","version":"12.0.0","description":"Axios paramsSerializer that turns deeply nested objects and arrays into model bindable query parameters.","keywords":["http","http-params","query-string","query-params","querystring","nested-objects","serializer","typescript","axios","params-serializer","interceptor"],"license":"MIT","author":{"name":"Adam Pluciński","email":"adaskothebeast@gmail.com","url":"https://github.com/adaskothebeast"},"repository":{"type":"git","url":"git+https://github.com/AdaskoTheBeAsT/HttpParamsProcessor.git"},"bugs":{"url":"https://github.com/AdaskoTheBeAsT/HttpParamsProcessor/issues"},"homepage":"https://github.com/AdaskoTheBeAsT/HttpParamsProcessor","type":"module","sideEffects":false,"main":"./index.cjs","module":"./index.js","types":"./index.d.ts","peerDependencies":{"@adaskothebeast/http-params-processor-core":"^12.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js","default":"./index.js","require":"./index.cjs"},"./package.json":"./package.json"},"gitHead":"73d31a6c26a6f2819f6c98aabb36659532e4cdd0","_id":"@adaskothebeast/http-params-processor-axios@12.0.0","_nodeVersion":"24.18.0","_npmVersion":"11.16.0","dist":{"integrity":"sha512-x4DJ5ReysTvNhdmrSMPfxioHYpt6fH92DCRadn2/NdcjJey6QAVGDr8R+/pIvsgSmqX9WX74MtK6fc/cFypt1Q==","shasum":"ae9ef8ed1e2cf8071af04e5367fb3f03b7c6a66e","tarball":"https://registry.npmjs.org/@adaskothebeast/http-params-processor-axios/-/http-params-processor-axios-12.0.0.tgz","fileCount":9,"unpackedSize":27511,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQD9knGexW0AB4YW8UyiLXVggJpbpHNpcPLuIHYzyOllwQIhAIvIjhHoPC7mv6V44eyGP2juaOqg/DslU0A3D5IYA+UK"}]},"_npmUser":{"name":"adasko","email":"adaskothebeast@gmail.com"},"directories":{},"maintainers":[{"name":"adasko","email":"adaskothebeast@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/http-params-processor-axios_12.0.0_1785235834835_0.2239147923430549"},"_hasShrinkwrap":false}},"time":{"created":"2026-01-10T20:29:58.417Z","modified":"2026-07-28T10:50:35.192Z","10.0.0":"2026-01-10T20:29:58.657Z","11.0.0":"2026-01-18T17:42:56.174Z","11.1.0":"2026-01-18T17:55:16.943Z","12.0.0":"2026-07-28T10:50:34.978Z"},"bugs":{"url":"https://github.com/AdaskoTheBeAsT/HttpParamsProcessor/issues"},"author":{"name":"Adam Pluciński","email":"adaskothebeast@gmail.com","url":"https://github.com/adaskothebeast"},"license":"MIT","homepage":"https://github.com/AdaskoTheBeAsT/HttpParamsProcessor","repository":{"type":"git","url":"git+https://github.com/AdaskoTheBeAsT/HttpParamsProcessor.git"},"maintainers":[{"name":"adasko","email":"adaskothebeast@gmail.com"}],"readme":"# 🅰️ @adaskothebeast/http-params-processor-axios\n\n**The axios adapter of [HttpParamsProcessor](https://github.com/AdaskoTheBeAsT/HttpParamsProcessor): a `paramsSerializer` (or a pre-flattened params object) built from deeply nested objects.**\n\n[![npm](https://img.shields.io/npm/v/%40adaskothebeast%2Fhttp-params-processor-axios?color=cb3837&logo=npm)](https://www.npmjs.com/package/@adaskothebeast/http-params-processor-axios)\n[![license](https://img.shields.io/badge/license-MIT-blue.svg)](./LICENSE)\n\nOnly `core` is a peer dependency. **axios itself is not a dependency and is never imported** - this package just produces strings and plain objects that axios understands. ESM only (`\"type\": \"module\"`). `sideEffects: false`.\n\n---\n\n## 📦 Install\n\n```bash\nnpm i @adaskothebeast/http-params-processor-axios @adaskothebeast/http-params-processor-core\n```\n\nPeer dependencies: `@adaskothebeast/http-params-processor-core ^12.0.0`. Bring your own axios at whatever version you already use.\n\n---\n\n## 🎯 What it does\n\naxios does not flatten nested params for you, so `{ filter: { price: { min: 100 } } }` ends up serialized in whatever shape its default serializer picks. This package gives you two ways out:\n\n- **`paramsSerializer`** - take over serialization completely and emit `filter.price.min=100`,\n- **`toParams`** - pre-flatten into `{ 'filter.price.min': '100' }` and let axios send it as-is.\n\n---\n\n## 🧰 API\n\n### `AxiosParamsProcessor`\n\n| Member                                | Returns                              | Notes                                                      |\n| ------------------------------------- | ------------------------------------ | ---------------------------------------------------------- |\n| `new AxiosParamsProcessor(config?)`   | -                                    | `config` sets instance-wide defaults                       |\n| `createAxiosParamsProcessor(config?)` | `AxiosParamsProcessor`               | Factory helper, identical to the constructor               |\n| `serialize(key, obj, options?)`       | `string`                             | `key=value` pairs joined with `&`, encoded unless disabled |\n| `createSerializer(key, options?)`     | `(params) => string`                 | Ready to drop into `paramsSerializer`                      |\n| `toParams(key, obj, options?)`        | `Record<string, string \\| string[]>` | Delegates to `ParamsProcessor.toPlainObject`               |\n| `coreProcessor`                       | `ParamsProcessor`                    | Getter for the underlying core instance                    |\n\n### Standalone helper\n\n`createParamsSerializer(key, config?)` builds a throwaway processor and returns its serializer in one call.\n\n### Types\n\n`AxiosParamsProcessorConfig` (`{ keyFormatter?, valueConverters? }`) and `AxiosParamsProcessorOptions`, which extends the core `ParamsProcessorOptions` with `encode?: boolean`.\n\n### Re-exports from `core`\n\nValues: `ValueConverter`, `createValueConverter`, `DefaultKeyFormattingStrategy`, `DefaultDateValueFromStrategy`, `DefaultDateValueToStrategy`, `DefaultPrimitiveValueToStrategy`.\nTypes: `ParamsProcessorOptions`, `ProcessableInput`, `ParamsEntry`, `IKeyFormattingStrategy`, `IValueConverter`, `IValueFromStrategy`, `IValueToStrategy`, `DurationComponents`, `PeriodComponents`.\n\n---\n\n## ⚡ Usage\n\n```ts\nimport { createAxiosParamsProcessor } from '@adaskothebeast/http-params-processor-axios';\nimport axios from 'axios';\n\nconst processor = createAxiosParamsProcessor();\n\n// 1. take over serialization\nawait axios.get('/api/products', {\n  params: { category: 'electronics', price: { min: 100, max: 500 } },\n  paramsSerializer: processor.createSerializer('filter'),\n});\n// GET /api/products?filter.category=electronics&filter.price.min=100&filter.price.max=500\n\n// 2. or pre-flatten and let axios send the object\nawait axios.get('/api/products', {\n  params: processor.toParams('filter', { user: { name: 'John' } }),\n  // { 'filter.user.name': 'John' }\n});\n```\n\nGlobal default for every request:\n\n```ts\naxios.defaults.paramsSerializer = processor.createSerializer('filter');\n```\n\nOne-off, without keeping an instance around:\n\n```ts\nimport { createParamsSerializer } from '@adaskothebeast/http-params-processor-axios';\n\nawait axios.get('/api', {\n  params: myObject,\n  paramsSerializer: createParamsSerializer('filter'),\n});\n```\n\n---\n\n## 🎛️ Options and configuration\n\n```ts\nconst processor = new AxiosParamsProcessor({\n  keyFormatter: new BracketNotationKeyFormattingStrategy(),\n  valueConverters: [createValueConverter(new LuxonDateTimeValueFromStrategy(), new IsoDateValueToStrategy())],\n});\n```\n\n| Option            | Where                                         | Effect                                                         |\n| ----------------- | --------------------------------------------- | -------------------------------------------------------------- |\n| `keyFormatter`    | constructor config, or per call in `options`  | How nested keys are spelled                                    |\n| `valueConverters` | constructor config, or per call in `options`  | `from -> to` pipeline; first `canHandle` wins                  |\n| `encode`          | `serialize` / `createSerializer` options only | `true` (default) applies `encodeURIComponent` to key and value |\n\n`toParams` takes the core `ParamsProcessorOptions` only; `encode` has no meaning there because axios does the encoding.\n\n---\n\n## 📤 Output examples\n\n```ts\nconst processor = new AxiosParamsProcessor();\n\nprocessor.serialize('filter', { status: 'active', count: 10 });\n// filter.status=active&filter.count=10\n\nprocessor.serialize('filter', { user: { name: 'John', age: 30 } });\n// filter.user.name=John&filter.user.age=30\n\nprocessor.serialize('items', ['a', 'b', 'c']);\n// items%5B0%5D=a&items%5B1%5D=b&items%5B2%5D=c\n\nprocessor.serialize('filter', { query: 'hello world' });\n// filter.query=hello%20world\n\nprocessor.serialize('filter', { query: 'hello world' }, { encode: false });\n// filter.query=hello world\n\nprocessor.serialize('filter', { createdAt: new Date('2024-01-01T00:00:00.000Z') });\n// filter.createdAt=2024-01-01T00%3A00%3A00.000Z\n\nprocessor.serialize('filter', { active: true, deleted: false });\n// filter.active=true&filter.deleted=false\n\nprocessor.serialize('filter', { a: 'value', b: null, c: undefined, d: 'another' });\n// filter.a=value&filter.d=another\n\nprocessor.toParams('filter', { status: 'active', user: { name: 'John' } });\n// { 'filter.status': 'active', 'filter.user.name': 'John' }\n\nprocessor.toParams('items', ['a', 'b']);\n// { 'items[0]': 'a', 'items[1]': 'b' }\n```\n\n---\n\n## ⚠️ Edge cases\n\n- **An empty root key still produces a leading dot.** `serialize('', { status: 'active' })` returns `.status=active`, because the default formatter joins parent and property with `.`. Pass a real prefix (`'filter'`), or use a key formatter that handles an empty parent, if your backend cannot accept it.\n- `encode: false` emits raw characters (`filter.query=hello world`). axios does **not** re-encode the string a `paramsSerializer` returns, so only disable encoding when you encode later yourself.\n- With the default formatter every key is unique, so `toParams` values are plain strings. Array values appear only when a key formatter deliberately repeats a key (Rails style `items[]`), and then axios' own serializer decides how to render them.\n- `null` and `undefined` are skipped at every depth, so no `key=` pairs are produced for them.\n- A `$type` property is ignored, and circular references throw `Error: Circular reference detected at key: <key>`.\n- Everything that is not matched by a converter falls back to `String(value)`.\n- `serialize` never adds a leading `?`; axios joins the query string to the URL itself.\n- Providing `valueConverters` replaces the core defaults, so include `Date` and primitive converters if you still need them.\n\n---\n\n## 🔗 Related packages\n\n- Engine: [`-core`](https://www.npmjs.com/package/@adaskothebeast/http-params-processor-core)\n- Other adapters: [`-fetch`](https://www.npmjs.com/package/@adaskothebeast/http-params-processor-fetch), [`-angular`](https://www.npmjs.com/package/@adaskothebeast/http-params-processor-angular), [`-angular-resource`](https://www.npmjs.com/package/@adaskothebeast/http-params-processor-angular-resource), [`-react-tanstack-query`](https://www.npmjs.com/package/@adaskothebeast/http-params-processor-react-tanstack-query), [`-react-swr`](https://www.npmjs.com/package/@adaskothebeast/http-params-processor-react-swr)\n- Key formatting: `-key-bracket-notation`, `-key-rails`, `-key-flat`, `-key-custom-delimiter`, `-key-json`\n- Values: `-value-from-*` and `-value-to-*`\n\nFull matrix and recipes: [main README](https://github.com/AdaskoTheBeAsT/HttpParamsProcessor#readme).\n\n---\n\n## 📄 License\n\n[MIT](./LICENSE) © Adam Pluciński\n","readmeFilename":"README.md","description":"Axios paramsSerializer that turns deeply nested objects and arrays into model bindable query parameters.","keywords":["http","http-params","query-string","query-params","querystring","nested-objects","serializer","typescript","axios","params-serializer","interceptor"]}