{"_id":"fetch-addons","_rev":"5-b1b1ea85fe2d4ad18c2bedf32926c5b9","name":"fetch-addons","dist-tags":{"latest":"1.3.0"},"versions":{"1.0.0":{"name":"fetch-addons","version":"1.0.0","keywords":["fetch","fetch-api","fetch-addons","fetch-helpers","fetch-utils","curl","fetch-to-curl"],"author":{"url":"https://meijer.ws","name":"Stephan Meijer","email":"stephan.meijer@gmail.com"},"license":"MIT","_id":"fetch-addons@1.0.0","maintainers":[{"name":"smeijer","email":"stephan.meijer@gmail.com"}],"homepage":"https://github.com/smeijer/fetch-addons#readme","bugs":{"url":"https://github.com/smeijer/fetch-addons/issues"},"dist":{"shasum":"34ef1ca43446ec8d11ef10994b9739126692adbc","tarball":"https://registry.npmjs.org/fetch-addons/-/fetch-addons-1.0.0.tgz","fileCount":11,"integrity":"sha512-Vwq599YGrpFqRmDYu+Yk6GDnJpSrOPDNjYmGnznhNxGazeJfcfp9z3C6x8o1N8svLyLW7NZjYmvQZ6m+i8sFhg==","signatures":[{"sig":"MEYCIQDhY7bcqOuQ1F7YCVCWng4mhNSqMIwKTHc3Fus2APgExwIhAP0ZHTqbiRc1+Kdpp3BHQ0Hdk3FCkYJpFY3RKu0KJ/ft","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":5762},"type":"module","types":"./dist/index.d.ts","engines":{"node":">=16"},"exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"./*.js":{"types":"./dist/*.d.ts","default":"./dist/*.js"}},"funding":"https://github.com/smeijer/fetch-addons?sponsor=1","gitHead":"485623f3b3417d34492e36580c4976635328bcf5","scripts":{"test":"prettier -w . && eslint . --fix && jest","build":"rimraf ./dist && tsc -p tsconfig.build.json","prepare":"npm run build"},"_npmUser":{"name":"smeijer","email":"stephan.meijer@gmail.com"},"repository":{"url":"git+https://github.com/smeijer/fetch-addons.git","type":"git"},"_npmVersion":"9.5.1","description":"A collection of addons for the fetch API","directories":{},"_nodeVersion":"18.16.1","_hasShrinkwrap":false,"devDependencies":{"jest":"^29.5.0","rimraf":"^5.0.1","ts-jest":"^29.1.1","ts-node":"^10.9.1","typescript":"^5.1.6","@types/jest":"^29.5.2","@smeijer/tsconfig":"^1.0.0","@smeijer/eslint-config":"^1.1.0"},"_npmOperationalInternal":{"tmp":"tmp/fetch-addons_1.0.0_1688560944565_0.5406249343475993","host":"s3://npm-registry-packages"}},"1.0.1":{"name":"fetch-addons","version":"1.0.1","keywords":["fetch","fetch-api","fetch-addons","fetch-helpers","fetch-utils","curl","fetch-to-curl"],"author":{"url":"https://meijer.ws","name":"Stephan Meijer","email":"stephan.meijer@gmail.com"},"license":"MIT","_id":"fetch-addons@1.0.1","maintainers":[{"name":"smeijer","email":"stephan.meijer@gmail.com"}],"homepage":"https://github.com/smeijer/fetch-addons#readme","bugs":{"url":"https://github.com/smeijer/fetch-addons/issues"},"dist":{"shasum":"bcdc04470f1b45424b3c8248464726fc0c24818b","tarball":"https://registry.npmjs.org/fetch-addons/-/fetch-addons-1.0.1.tgz","fileCount":11,"integrity":"sha512-yNl+B5MKSAeQva/qiyHkujIl2zU/ozK42un6I2JsGmX9A3VKKyrByVWwB3wB5euuoCJ+rxqJi4D98aHyfb9vSA==","signatures":[{"sig":"MEUCICbzxwDfuc48Bf/MIdbWFplkK5Z/Q5v2ZkgIxTU0x+v2AiEArT6kQi/H/ECTv94Szy6zPlDXM3/P4m3uL80SkzevinI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":5770},"type":"module","types":"./dist/index.d.ts","engines":{"node":">=16"},"exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"./*.js":{"types":"./dist/*.d.ts","default":"./dist/*.js"}},"funding":"https://github.com/smeijer/fetch-addons?sponsor=1","gitHead":"aa717818059ec095e501696f1e602762974f00f5","scripts":{"test":"prettier -w . && eslint . --fix && jest","build":"rimraf ./dist && tsc -p tsconfig.build.json","prepare":"npm run build"},"_npmUser":{"name":"smeijer","email":"stephan.meijer@gmail.com"},"repository":{"url":"git+https://github.com/smeijer/fetch-addons.git","type":"git"},"_npmVersion":"9.5.1","description":"A collection of addons for the fetch API","directories":{},"_nodeVersion":"18.16.1","_hasShrinkwrap":false,"devDependencies":{"jest":"^29.5.0","rimraf":"^5.0.1","ts-jest":"^29.1.1","ts-node":"^10.9.1","typescript":"^5.1.6","@types/jest":"^29.5.2","@smeijer/tsconfig":"^1.0.0","@smeijer/eslint-config":"^1.1.0"},"_npmOperationalInternal":{"tmp":"tmp/fetch-addons_1.0.1_1688565099498_0.26355771929675087","host":"s3://npm-registry-packages"}},"1.0.2":{"name":"fetch-addons","version":"1.0.2","keywords":["fetch","fetch-api","fetch-addons","fetch-helpers","fetch-utils","curl","fetch-to-curl"],"author":{"url":"https://meijer.ws","name":"Stephan Meijer","email":"stephan.meijer@gmail.com"},"license":"MIT","_id":"fetch-addons@1.0.2","maintainers":[{"name":"smeijer","email":"stephan.meijer@gmail.com"}],"homepage":"https://github.com/smeijer/fetch-addons#readme","bugs":{"url":"https://github.com/smeijer/fetch-addons/issues"},"dist":{"shasum":"dca10175128362bcc59ffb98b4eb818369cf6f85","tarball":"https://registry.npmjs.org/fetch-addons/-/fetch-addons-1.0.2.tgz","fileCount":11,"integrity":"sha512-n2B5OANmAtyJ/ynhjtnBPUnSm9sJnYDQ6TaRTIThlYHdtjDdgRFSBzZHKu6JaR2vbzomzekDY8skgFS2lI6rdA==","signatures":[{"sig":"MEYCIQC3TNjZqKmmDYLczltCTe3kJ/ZjPD/DlMJ3UpNBtKk0dAIhAOoBXvch/GqHD1Flw9hHiM2xD2XOG7LfLPNbI9LT+Nlv","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":5798},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","engines":{"node":">=16"},"exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"./*.js":{"types":"./dist/*.d.ts","default":"./dist/*.js"}},"funding":"https://github.com/smeijer/fetch-addons?sponsor=1","gitHead":"71d24a5c996ef1076bec94bb7d92a01ce8fc586e","scripts":{"test":"prettier -w . && eslint . --fix && jest","build":"rimraf ./dist && tsc -p tsconfig.build.json","prepare":"npm run build"},"_npmUser":{"name":"smeijer","email":"stephan.meijer@gmail.com"},"repository":{"url":"git+https://github.com/smeijer/fetch-addons.git","type":"git"},"_npmVersion":"9.5.1","description":"A collection of addons for the fetch API","directories":{},"_nodeVersion":"18.16.1","_hasShrinkwrap":false,"devDependencies":{"jest":"^29.5.0","rimraf":"^5.0.1","ts-jest":"^29.1.1","ts-node":"^10.9.1","typescript":"^5.1.6","@types/jest":"^29.5.2","@smeijer/tsconfig":"^1.0.0","@smeijer/eslint-config":"^1.1.0"},"_npmOperationalInternal":{"tmp":"tmp/fetch-addons_1.0.2_1688565277480_0.730526984962683","host":"s3://npm-registry-packages"}},"1.1.0":{"name":"fetch-addons","version":"1.1.0","keywords":["fetch","fetch-api","fetch-addons","fetch-helpers","fetch-utils","curl","fetch-to-curl"],"author":{"url":"https://meijer.ws","name":"Stephan Meijer","email":"stephan.meijer@gmail.com"},"license":"MIT","_id":"fetch-addons@1.1.0","maintainers":[{"name":"smeijer","email":"stephan.meijer@gmail.com"}],"homepage":"https://github.com/smeijer/fetch-addons#readme","bugs":{"url":"https://github.com/smeijer/fetch-addons/issues"},"dist":{"shasum":"78365883b1f04d66f213fd14fd7592fde55828c3","tarball":"https://registry.npmjs.org/fetch-addons/-/fetch-addons-1.1.0.tgz","fileCount":12,"integrity":"sha512-rjCmYOMgSpuoyEkPiNgIljAn77SpbGV+COIOozcrjNJasNFFXHh7vuRXTt89oRj0qFoPfjULWAc9Or+f3MFSKQ==","signatures":[{"sig":"MEYCIQCwSQdncdGHikBcUcswvty+61Hs/JvC4rVtWPQsKHq0fQIhAKtEw7CJbX26j0huX8x9D5ZWNtxWqFgZIJafeLk87Wcn","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":8243},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","engines":{"node":">=16"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"},"./*.js":{"types":"./dist/*.d.ts","import":"./dist/*.js"}},"funding":"https://github.com/smeijer/fetch-addons?sponsor=1","gitHead":"b44e98987c2382429d0b62424147740710f29643","scripts":{"test":"prettier -w . && eslint . --fix && jest","build":"rimraf ./dist && tsc -p tsconfig.build.json && npm run build:cjs","prepare":"npm run build","build:cjs":"esbuild src/index.ts --bundle --outfile=dist/index.cjs --format=cjs --platform=node"},"_npmUser":{"name":"smeijer","email":"stephan.meijer@gmail.com"},"repository":{"url":"git+https://github.com/smeijer/fetch-addons.git","type":"git"},"_npmVersion":"9.5.1","description":"A collection of addons for the fetch API","directories":{},"_nodeVersion":"18.16.1","_hasShrinkwrap":false,"devDependencies":{"jest":"^29.5.0","rimraf":"^5.0.1","esbuild":"^0.18.11","ts-jest":"^29.1.1","ts-node":"^10.9.1","typescript":"^5.1.6","@types/jest":"^29.5.2","@smeijer/tsconfig":"^1.0.0","@smeijer/eslint-config":"^1.1.0"},"_npmOperationalInternal":{"tmp":"tmp/fetch-addons_1.1.0_1688744311680_0.7828459996152564","host":"s3://npm-registry-packages"}},"1.2.0":{"name":"fetch-addons","version":"1.2.0","keywords":["fetch","fetch-api","fetch-addons","fetch-helpers","fetch-utils","curl","fetch-to-curl"],"author":{"url":"https://meijer.ws","name":"Stephan Meijer","email":"stephan.meijer@gmail.com"},"license":"MIT","_id":"fetch-addons@1.2.0","maintainers":[{"name":"smeijer","email":"stephan.meijer@gmail.com"}],"homepage":"https://github.com/smeijer/fetch-addons#readme","bugs":{"url":"https://github.com/smeijer/fetch-addons/issues"},"dist":{"shasum":"a7ca3fc7221a6cb8deba59c258832481e8d8b2a6","tarball":"https://registry.npmjs.org/fetch-addons/-/fetch-addons-1.2.0.tgz","fileCount":12,"integrity":"sha512-e1xtLHBS8eXTkTkkBsZZbjppd+3bzRKJ7+a9AE2vLH8eDU5FjHa8JCrUhd4JL9cgRlo3qmBs6JYq2J3UBabMDw==","signatures":[{"sig":"MEUCIHy3SIgVRz8A2c0GIY/dq/Ucx/tdHx/Tro0XkhmrKJVQAiEAldIU8LAmCfwvM1QH8T67zmZowjeU0TF+apnojNaT/PA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":8279},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","engines":{"node":">=16"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"},"./*.js":{"types":"./dist/*.d.ts","import":"./dist/*.js"}},"funding":"https://github.com/smeijer/fetch-addons?sponsor=1","gitHead":"a85181d6fd7b54bdd2b0047ba138420d8355cc15","scripts":{"test":"prettier -w . && eslint . --fix && globstar -- node --test --import tsx src/**.test.ts","build":"rimraf ./dist && tsc -p tsconfig.build.json && npm run build:cjs","prepare":"npm run build","build:cjs":"esbuild src/index.ts --bundle --outfile=dist/index.cjs --format=cjs --platform=node"},"_npmUser":{"name":"smeijer","email":"stephan.meijer@gmail.com"},"repository":{"url":"git+https://github.com/smeijer/fetch-addons.git","type":"git"},"_npmVersion":"10.2.3","description":"A collection of addons for the fetch API","directories":{},"_nodeVersion":"18.19.0","_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.10.4","rimraf":"^5.0.1","esbuild":"^0.18.11","globstar":"^1.0.0","typescript":"^5.1.6","@types/node":"^18.19.33","@smeijer/tsconfig":"^1.0.0","@smeijer/eslint-config":"^1.1.0"},"_npmOperationalInternal":{"tmp":"tmp/fetch-addons_1.2.0_1715951358314_0.9987367080452207","host":"s3://npm-registry-packages"}},"1.3.0":{"name":"fetch-addons","version":"1.3.0","description":"A collection of addons for the fetch API","license":"MIT","repository":{"type":"git","url":"git+https://github.com/smeijer/fetch-addons.git"},"funding":"https://github.com/smeijer/fetch-addons?sponsor=1","author":{"name":"Stephan Meijer","email":"stephan.meijer@gmail.com","url":"https://meijer.ws"},"tshy":{"project":"./tsconfig.build.json","exclude":["src/**/*.test.ts"],"exports":{".":"./src/index.ts","./headers":"./src/headers.ts","./request":"./src/request.ts","./to-curl":"./src/to-curl.ts","./package.json":"./package.json"}},"type":"module","engines":{"node":">=16"},"scripts":{"test":"prettier -w . && eslint . --fix && globstar -- node --test --import tsx src/**.test.ts","build":"rimraf ./dist && tshy"},"keywords":["fetch","fetch-api","fetch-addons","fetch-helpers","fetch-utils","curl","fetch-to-curl"],"devDependencies":{"@arethetypeswrong/cli":"^0.16.2","@smeijer/eslint-config":"^1.1.0","@smeijer/tsconfig":"^1.0.0","@types/node":"^18.19.33","esbuild":"^0.18.11","globstar":"^1.0.0","rimraf":"^5.0.1","tshy":"^3.0.2","tsx":"^4.10.4","typescript":"^5.1.6"},"exports":{".":{"import":{"types":"./dist/esm/index.d.ts","default":"./dist/esm/index.js"},"require":{"types":"./dist/commonjs/index.d.ts","default":"./dist/commonjs/index.js"}},"./headers":{"import":{"types":"./dist/esm/headers.d.ts","default":"./dist/esm/headers.js"},"require":{"types":"./dist/commonjs/headers.d.ts","default":"./dist/commonjs/headers.js"}},"./request":{"import":{"types":"./dist/esm/request.d.ts","default":"./dist/esm/request.js"},"require":{"types":"./dist/commonjs/request.d.ts","default":"./dist/commonjs/request.js"}},"./to-curl":{"import":{"types":"./dist/esm/to-curl.d.ts","default":"./dist/esm/to-curl.js"},"require":{"types":"./dist/commonjs/to-curl.d.ts","default":"./dist/commonjs/to-curl.js"}},"./package.json":"./package.json"},"main":"./dist/commonjs/index.js","types":"./dist/commonjs/index.d.ts","module":"./dist/esm/index.js","_id":"fetch-addons@1.3.0","gitHead":"4a3189c38c809d6424e878f2c6f55e15c88f5243","bugs":{"url":"https://github.com/smeijer/fetch-addons/issues"},"homepage":"https://github.com/smeijer/fetch-addons#readme","_nodeVersion":"20.15.0","_npmVersion":"10.7.0","dist":{"integrity":"sha512-3yQY6axQlA6waoberzRnImaWlASGiIGsF/nW+fxZ0zOJEYtw1DWrUqPBc2c3FcbbTJcssdte3C3HlcmKgbpFSA==","shasum":"594ec77306f5395e7d059cb7f8044c7c2408609d","tarball":"https://registry.npmjs.org/fetch-addons/-/fetch-addons-1.3.0.tgz","fileCount":21,"unpackedSize":10160,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGU2WFFT9Ed0j61SjjwUOTPw+46btubINPWBFhAx0lrOAiEA05bLGvi4K8JVqs513ZHhz7WjGMKYykwcl3dPzA68CxQ="}]},"_npmUser":{"name":"smeijer","email":"stephan.meijer@gmail.com"},"directories":{},"maintainers":[{"name":"smeijer","email":"stephan.meijer@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-addons_1.3.0_1726068300560_0.9253704250433223"},"_hasShrinkwrap":false}},"time":{"created":"2023-07-05T12:42:24.564Z","modified":"2024-09-11T15:25:00.946Z","1.0.0":"2023-07-05T12:42:24.743Z","1.0.1":"2023-07-05T13:51:39.721Z","1.0.2":"2023-07-05T13:54:37.682Z","1.1.0":"2023-07-07T15:38:31.848Z","1.2.0":"2024-05-17T13:09:18.456Z","1.3.0":"2024-09-11T15:25:00.788Z"},"bugs":{"url":"https://github.com/smeijer/fetch-addons/issues"},"author":{"name":"Stephan Meijer","email":"stephan.meijer@gmail.com","url":"https://meijer.ws"},"license":"MIT","homepage":"https://github.com/smeijer/fetch-addons#readme","keywords":["fetch","fetch-api","fetch-addons","fetch-helpers","fetch-utils","curl","fetch-to-curl"],"repository":{"type":"git","url":"git+https://github.com/smeijer/fetch-addons.git"},"description":"A collection of addons for the fetch API","maintainers":[{"name":"smeijer","email":"stephan.meijer@gmail.com"}],"readme":"# Fetch Addons\n\n> A collection of addons for the fetch API.\n\n## Install\n\n```sh\nnpm install fetch-addons\n```\n\n## Usage\n\n```js\nimport * as addons from 'fetch-addons';\n```\n\n### toCurl\n\nSerializes a `Request` object to a cURL command. Handy for logging and replaying failed requests.\n\n```js\nimport { toCurl } from 'fetch-addons';\n\n// fetch(input, init)\ntoCurl(input, init);\ntoCurl(request);\n\n// curl --url 'https://example.com' \\\n//   --request 'POST' \\\n//   --header 'content-type: application/json' \\\n//   --data '{\"foo\":\"bar\"}'`\n```\n\n### getRequest\n\nGet a `Request` object from `RequestInit`.\n\n```js\nimport { getRequest } from 'fetch-addons';\n\n// fetch(input, init);\nconst request = getRequest(input, init);\nconst request = getRequest(request);\n```\n\n### getHeaders\n\nGet a `Headers` object from `HeadersInit`.\n\n```js\nimport { getHeaders } from 'fetch-addons';\n\n// fetch(input, init);\nconst headers = getHeaders(init.headers);\n\nfetch('https://example.com').then((response) => {\n\tconst headers = getHeaders(response.headers);\n});\n```\n\n### deleteEmptyHeaders\n\nDelete empty headers from a `Headers` object.\n\n```js\nimport { deleteEmptyHeaders } from 'fetch-addons';\n\nconst request = new Request('https://example.com', {\n\theaders: {\n\t\t'content-type': 'application/json',\n\t\t'x-1': '',\n\t\t'x-2': 'undefined',\n\t\t'x-3': 'null',\n\t},\n});\n\ndeleteEmptyHeaders(request.headers);\n// Headers { 'content-type': 'application/json' }\n```\n","readmeFilename":"readme.md"}