{"_id":"@autosec/fetchhole","_rev":"54-1d1cf7cdc70e05699dc4118420d17487","time":{"created":"2023-12-15T04:17:47.068Z","0.0.1-beta.0":"2023-11-20T22:00:48.460Z","modified":"2023-12-21T05:32:01.102Z","0.0.1-nightly.0":"2023-11-20T23:04:32.795Z","0.0.1-nightly.3":"2023-11-22T21:05:50.858Z","0.0.1-nightly.4":"2023-11-22T21:27:06.902Z","0.0.1-nightly.5":"2023-11-22T21:33:47.212Z","0.0.1-nightly.6":"2023-11-22T21:38:30.150Z","0.0.1-nightly.7":"2023-11-22T21:42:31.687Z","0.0.1-nightly.8":"2023-11-22T21:46:44.574Z","0.0.1-nightly.9":"2023-11-22T22:09:27.057Z","0.0.1-nightly.10":"2023-11-22T22:53:11.880Z","0.0.1-nightly.12":"2023-11-23T00:09:54.396Z","0.0.1-nightly.13":"2023-11-23T00:20:25.087Z","0.0.1-nightly.14":"2023-11-23T01:43:35.701Z","0.0.1-nightly.15":"2023-11-23T02:19:44.545Z","0.0.1-nightly.16":"2023-11-23T04:39:23.342Z","0.0.1-nightly.17":"2023-11-23T04:51:00.863Z","0.0.1-nightly.18":"2023-11-23T06:42:58.042Z","0.0.1-nightly.19":"2023-11-29T23:35:01.104Z","0.0.1-nightly.20":"2023-11-30T00:18:42.952Z","0.0.1-nightly.21":"2023-12-14T05:04:30.468Z","0.0.1-nightly.22":"2023-12-14T05:29:52.610Z","0.0.1-nightly.23":"2023-12-14T06:47:05.278Z","0.0.1-nightly.24":"2023-12-14T06:53:52.944Z","0.0.1-nightly.25":"2023-12-14T19:09:44.278Z","0.0.1-nightly.26":"2023-12-14T19:57:52.156Z","0.0.1-nightly.27":"2023-12-14T21:09:21.393Z","0.0.1-nightly.28":"2023-12-14T23:35:17.601Z","0.0.1-nightly.29":"2023-12-15T00:08:47.640Z","0.0.1-nightly.30":"2023-12-15T00:15:25.733Z","0.0.1-nightly.31":"2023-12-15T01:00:30.442Z","0.0.1-nightly.32":"2023-12-15T02:21:26.083Z","0.0.1-nightly.33":"2023-12-15T03:46:37.026Z","0.1.1-nightly.0":"2023-12-15T04:17:47.413Z","0.1.1-nightly.1":"2023-12-15T04:53:53.821Z","0.1.1-nightly.2":"2023-12-15T23:08:40.641Z","0.1.1-nightly.3":"2023-12-16T00:04:46.462Z","0.1.1-nightly.4":"2023-12-16T01:22:17.091Z","0.1.1-nightly.6":"2023-12-20T00:07:23.006Z","0.1.1-beta.0":"2023-12-20T00:17:43.939Z","0.1.1-beta.1":"2023-12-20T00:39:39.200Z","0.1.1-nightly.7":"2023-12-20T18:14:07.509Z","0.1.1-nightly.8":"2023-12-20T18:17:28.633Z","0.1.1-nightly.9":"2023-12-20T19:37:37.873Z","0.1.1-nightly.10":"2023-12-20T20:25:24.508Z","0.1.1-nightly.11":"2023-12-21T02:32:04.559Z","0.1.1-nightly.12":"2023-12-21T02:46:13.101Z","0.1.1-nightly.13":"2023-12-21T02:58:16.566Z","0.1.1-nightly.14":"2023-12-21T03:35:39.668Z","0.1.1-nightly.15":"2023-12-21T03:51:56.843Z","0.1.1-nightly.16":"2023-12-21T03:58:09.029Z","0.1.1-nightly.17":"2023-12-21T05:32:00.694Z"},"name":"@autosec/fetchhole","dist-tags":{"nightly":"0.1.1-nightly.17","latest":"0.1.1-nightly.0","beta":"0.1.1-beta.1"},"versions":{"0.1.1-nightly.0":{"name":"@autosec/fetchhole","version":"0.1.1-nightly.0","description":"Boost your FaaS development with `@autosec/fetchhole`, a secure, drop-in replacement for the native `fetch()` function, designed for security-focused web developers.","type":"module","main":"./dist/index.mjs","types":"./dist/index.d.mts","scripts":{"build":"tsc","build:watch":"npm run build -- --watch","test":"node --loader ts-node/esm --test --test-reporter=spec"},"repository":{"type":"git","url":"git+https://github.com/autosec-network/FetchHole.git"},"author":{"name":"Autosec"},"contributors":[{"name":"DemosJarco","email":"1209494+demosjarco@users.noreply.github.com"},{"name":"Sam Gammon","email":"sam@elide.dev"}],"license":"MIT","bugs":{"url":"https://github.com/autosec-network/FetchHole/issues"},"homepage":"https://github.com/autosec-network/FetchHole#readme","engines":{"node":">=16.15.0"},"publishConfig":{"access":"public"},"exports":{".":"./dist/index.mjs"},"imports":{".":{"default":"./dist/index.mjs","types":"./dist/index.d.mts"}},"prettier":"@demosjarco/prettier-config","dependencies":{"chalk":"^5.3.0","dns-packet":"^5.6.1"},"devDependencies":{"@demosjarco/prettier-config":"^1.0.1","@swc/core":"^1.3.99","@types/dns-packet":"^5.6.4","@types/node":"^20.9.2","prettier":"^3.1.0","ts-node":"^10.9.1","typescript":"^5.3.2"},"_id":"@autosec/fetchhole@0.1.1-nightly.0","gitHead":"c9956f5f89d616d54a5117fd2be75fdbae2b7681","_nodeVersion":"20.10.0","_npmVersion":"10.2.3","dist":{"integrity":"sha512-X+e9wxjjlgFZQ8zcqbYTHOh0CTyto5UehwxLUAcM8R5bWonx5RRz/yq6XMa6DV733wnZZ1qlWth65rCRDTcbPw==","shasum":"0fdd0ade06aeec0e00c9de3b5bb69308ddb5243f","tarball":"https://registry.npmjs.org/@autosec/fetchhole/-/fetchhole-0.1.1-nightly.0.tgz","fileCount":24,"unpackedSize":56727,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@autosec%2ffetchhole@0.1.1-nightly.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDFQtw143T9ROy8yNJuOrLvjinEa0BxybQgOO6RGjeswgIgWM+EVurrzKez5jjeenYeUjmhTEvX63EC/hV3/IY95EY="}]},"_npmUser":{"name":"demosjarco","email":"demosjarco@protonmail.com"},"directories":{},"maintainers":[{"name":"demosjarco","email":"demosjarco@protonmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetchhole_0.1.1-nightly.0_1702613867152_0.04640296587004866"},"_hasShrinkwrap":false},"0.1.1-nightly.1":{"name":"@autosec/fetchhole","version":"0.1.1-nightly.1","description":"Boost your FaaS development with `@autosec/fetchhole`, a secure, drop-in replacement for the native `fetch()` function, designed for security-focused web developers.","type":"module","main":"./dist/index.mjs","types":"./dist/index.d.mts","scripts":{"build":"tsc","build:watch":"npm run build -- --watch","test":"node --loader ts-node/esm --test --test-reporter=spec"},"repository":{"type":"git","url":"git+https://github.com/autosec-network/FetchHole.git"},"author":{"name":"Autosec"},"contributors":[{"name":"DemosJarco","email":"1209494+demosjarco@users.noreply.github.com"},{"name":"Sam Gammon","email":"sam@elide.dev"}],"license":"MIT","bugs":{"url":"https://github.com/autosec-network/FetchHole/issues"},"homepage":"https://github.com/autosec-network/FetchHole#readme","engines":{"node":">=16.15.0"},"publishConfig":{"access":"public"},"exports":{".":"./dist/index.mjs"},"imports":{".":{"default":"./dist/index.mjs","types":"./dist/index.d.mts"}},"prettier":"@demosjarco/prettier-config","dependencies":{"chalk":"^5.3.0","dns-packet":"^5.6.1"},"devDependencies":{"@demosjarco/prettier-config":"^1.0.1","@swc/core":"^1.3.99","@types/dns-packet":"^5.6.4","@types/node":"^20.9.2","prettier":"^3.1.0","ts-node":"^10.9.1","typescript":"^5.3.2"},"_id":"@autosec/fetchhole@0.1.1-nightly.1","readme":"[![License](https://img.shields.io/github/license/autosec-network/FetchHole)](LICENSE)\n[![TypeScript](https://badgen.net/npm/types/@autosec-network/FetchHole)](https://www.npmjs.com/package/@autosec/fetchhole)\n[![npm](https://img.shields.io/npm/v/@autosec-network/FetchHole)](https://www.npmjs.com/package/@autosec/fetchhole)\n[![npm](https://img.shields.io/npm/dm/@autosec-network/FetchHole)](https://www.npmjs.com/package/@autosec/fetchhole)\n[![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/autosec-network/FetchHole/badge)](https://securityscorecards.dev/viewer/?uri=github.com/autosec-network/FetchHole)\n[![Socket Badge](https://socket.dev/api/badge/npm/package/@autosec-network/FetchHole)](https://socket.dev/npm/package/@autosec-network/FetchHole)\n\n# FetchHole\n\nElevate your Function as a Service (FaaS) development with enhanced security at the edge using `@autosec/fetchhole`. This package acts as a sophisticated drop-in replacement for the native fetch() function, tailored for developers who emphasize security in their web applications.\n\n## Features\n\n-   **Drop-in Replacement**: Seamlessly integrates with existing code, replacing the native `fetch()` function.\n-   **Advanced Logging**: Comprehensive logging capabilities for effective debugging.\n-   **Redirect Intercept**: Customize redirect limits with a default of 20, as per the WHATWG Fetch specification.\n-   **Header Computation**: Automatically computes and adds missing `Content-Length` and `ETag` headers. Choose your preferred ETag hash algorithm, with `sha256` as the default.\n-   **Cache Support**: Utilizes memory or disk caching via the Cache Web API. Compatible with Cloudflare's cache API for Cloudflare users.\n-   **Intercept for Alternate Routing**: Ideal for scenarios like Cloudflare Workers Binding, allowing for alternate request routing.\n-   **Custom DNS Resolver Support**: Designed for DNS level security applications like Zero Trust services. Compatible with any DoH resolver that uses `0.0.0.0` for blocking.\n    -   **Direct IP Address Handling**: Offers three modes for handling direct IP address access:\n        -   Full Block\n        -   Fail if No PTR Record (conducts a PTR record check, followed by a standard DNS check)\n        -   Allow\n\n## Installation\n\n```bash\nnpm install @autosec/fetchhole\n```\n\n## Usage\n\nSimply import fetchhole and use it as a replacement for the native fetch() function.\n\n```ts\nimport fetch from '@autosec/fetchhole';\n\n// Use fetch as you normally would\nfetch('https://example.com').then((response) => {\n\t// Your code here\n});\n```\n\n## Configuration\n\nYou can customize fetchhole with various options to suit your needs. Settings can be applied at the class instance level or as an fetch init property:\n\n```ts\n{\n\tcache: {\n\t\ttype: CacheType.Default, // Defines cache type\n\t\thashAlgorithm: 'sha256', // Choose a different ETag hash algorithm\n\t\tignoreMethod: false,\n\t\tignoreSearch: false,\n\t\tignoreVary: false,\n\t},\n\thardFail: true, // Determines failure handling\n\tlogLevel: LoggingLevel.INFO, // Sets the level of logging\n\tredirectCount: 20, // Set custom redirect limit\n}\n```\n","readmeFilename":"README.md","gitHead":"f0b6020a87542e0984778664f0a8ee2020f45a6f","_nodeVersion":"20.10.0","_npmVersion":"10.2.3","dist":{"integrity":"sha512-up+Gm3nmXZ8sNMBePgDiTKnSpt9MbyfrZYniLEukTmtNOdHx7ZxxoMJlp/a1Dfh+7kGV5o6FkXaXbF4FZNthpw==","shasum":"33187b9b751ff9919585407ea1550b2ca48348d5","tarball":"https://registry.npmjs.org/@autosec/fetchhole/-/fetchhole-0.1.1-nightly.1.tgz","fileCount":19,"unpackedSize":41360,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@autosec%2ffetchhole@0.1.1-nightly.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIF2qB6MAiMERVfBIAtQvdzcSlwKW2FLBeMkdYhvfCxfVAiBdp5hw8QRXZi400lyM9EWgAu9ugf77Y6S1iKBPtJmEXQ=="}]},"_npmUser":{"name":"demosjarco","email":"demosjarco@protonmail.com"},"directories":{},"maintainers":[{"name":"demosjarco","email":"demosjarco@protonmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetchhole_0.1.1-nightly.1_1702616033634_0.26117928703359805"},"_hasShrinkwrap":false},"0.1.1-nightly.2":{"name":"@autosec/fetchhole","version":"0.1.1-nightly.2","description":"Boost your FaaS development with `@autosec/fetchhole`, a secure, drop-in replacement for the native `fetch()` function, designed for security-focused web developers.","type":"module","main":"./dist/index.mjs","types":"./dist/index.d.mts","scripts":{"build":"tsc","build:watch":"npm run build -- --watch","test":"node --loader ts-node/esm --test --test-reporter=spec"},"repository":{"type":"git","url":"git+https://github.com/autosec-network/FetchHole.git"},"author":{"name":"Autosec"},"contributors":[{"name":"DemosJarco","email":"1209494+demosjarco@users.noreply.github.com"},{"name":"Sam Gammon","email":"sam@elide.dev"}],"license":"MIT","bugs":{"url":"https://github.com/autosec-network/FetchHole/issues"},"homepage":"https://github.com/autosec-network/FetchHole#readme","engines":{"node":">=16.15.0"},"publishConfig":{"access":"public"},"exports":{".":"./dist/index.mjs"},"imports":{".":{"default":"./dist/index.mjs","types":"./dist/index.d.mts"}},"prettier":"@demosjarco/prettier-config","dependencies":{"chalk":"^5.3.0","dns-packet":"^5.6.1"},"devDependencies":{"@demosjarco/prettier-config":"^1.0.1","@swc/core":"^1.3.99","@types/dns-packet":"^5.6.4","@types/node":"^20.9.2","prettier":"^3.1.0","ts-node":"^10.9.1","typescript":"^5.3.2"},"_id":"@autosec/fetchhole@0.1.1-nightly.2","readme":"[![License](https://img.shields.io/github/license/autosec-network/FetchHole)](LICENSE)\n[![TypeScript](https://badgen.net/npm/types/@autosec-network/FetchHole)](https://www.npmjs.com/package/@autosec/fetchhole)\n[![npm](https://img.shields.io/npm/v/@autosec-network/FetchHole)](https://www.npmjs.com/package/@autosec/fetchhole)\n[![npm](https://img.shields.io/npm/dm/@autosec-network/FetchHole)](https://www.npmjs.com/package/@autosec/fetchhole)\n[![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/autosec-network/FetchHole/badge)](https://securityscorecards.dev/viewer/?uri=github.com/autosec-network/FetchHole)\n[![Socket Badge](https://socket.dev/api/badge/npm/package/@autosec-network/FetchHole)](https://socket.dev/npm/package/@autosec-network/FetchHole)\n\n# FetchHole\n\nElevate your Function as a Service (FaaS) development with enhanced security at the edge using `@autosec/fetchhole`. This package acts as a sophisticated drop-in replacement for the native fetch() function, tailored for developers who emphasize security in their web applications.\n\n## Features\n\n-   **Drop-in Replacement**: Seamlessly integrates with existing code, replacing the native `fetch()` function.\n-   **Advanced Logging**: Comprehensive logging capabilities for effective debugging.\n-   **Redirect Intercept**: Customize redirect limits with a default of 20, as per the WHATWG Fetch specification.\n-   **Header Computation**: Automatically computes and adds missing `Content-Length` and `ETag` headers. Choose your preferred ETag hash algorithm, with `sha256` as the default.\n-   **Cache Support**: Utilizes memory or disk caching via the Cache Web API. Compatible with Cloudflare's cache API for Cloudflare users.\n-   **Intercept for Alternate Routing**: Ideal for scenarios like Cloudflare Workers Binding, allowing for alternate request routing.\n-   **Custom DNS Resolver Support**: Designed for DNS level security applications like Zero Trust services. Compatible with any DoH resolver that uses `0.0.0.0` for blocking.\n    -   **Direct IP Address Handling**: Offers three modes for handling direct IP address access:\n        -   Full Block\n        -   Fail if No PTR Record (conducts a PTR record check, followed by a standard DNS check)\n        -   Allow\n\n## Installation\n\n```bash\nnpm install @autosec/fetchhole\n```\n\n## Usage\n\nSimply import fetchhole and use it as a replacement for the native fetch() function.\n\n```ts\nimport fetch from '@autosec/fetchhole';\n\n// Use fetch as you normally would\nfetch('https://example.com').then((response) => {\n\t// Your code here\n});\n```\n\n## Configuration\n\nYou can customize fetchhole with various options to suit your needs. Settings can be applied at the class instance level or as an fetch init property:\n\n```ts\n{\n\tcache: {\n\t\ttype: CacheType.Default, // Defines cache type\n\t\thashAlgorithm: 'sha256', // Choose a different ETag hash algorithm\n\t\tignoreMethod: false,\n\t\tignoreSearch: false,\n\t\tignoreVary: false,\n\t},\n\thardFail: true, // Determines failure handling\n\tlogLevel: LoggingLevel.INFO, // Sets the level of logging\n\tredirectCount: 20, // Set custom redirect limit\n}\n```\n","readmeFilename":"README.md","gitHead":"b925e45b8c7dbd96e7e30aa2b0b77a4b63210b1f","_nodeVersion":"20.10.0","_npmVersion":"10.2.3","dist":{"integrity":"sha512-PxY+UXngaNsKLWkpF5ukQC69z6S+QMSSRLKCZKHGEidh7SED46Qxww5eVzwl2H8mpm3wFLOXEzPsRRNt9veU0Q==","shasum":"44eeea6ac960bb497d39381e1adf85e01dccca33","tarball":"https://registry.npmjs.org/@autosec/fetchhole/-/fetchhole-0.1.1-nightly.2.tgz","fileCount":19,"unpackedSize":42351,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@autosec%2ffetchhole@0.1.1-nightly.2","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGmpv41cxNRPWuag8C8Pw3BdMEGM818A3fRfAvlM/4CqAiEAwGrSlxjt53b2DKFH2wtc5A6H5K/9+Xb6uRm4nGB9buI="}]},"_npmUser":{"name":"demosjarco","email":"demosjarco@protonmail.com"},"directories":{},"maintainers":[{"name":"demosjarco","email":"demosjarco@protonmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetchhole_0.1.1-nightly.2_1702681720450_0.8013453207182772"},"_hasShrinkwrap":false},"0.1.1-nightly.3":{"name":"@autosec/fetchhole","version":"0.1.1-nightly.3","description":"Boost your FaaS development with fetchhole, a secure, drop-in replacement for the native `fetch()` function, designed for security-focused web developers.","type":"module","main":"./dist/index.mjs","types":"./dist/index.d.mts","scripts":{"build":"tsc","build:watch":"npm run build -- --watch","test":"node --loader ts-node/esm --test --test-reporter=spec"},"repository":{"type":"git","url":"git+https://github.com/autosec-network/FetchHole.git"},"author":{"name":"Autosec"},"contributors":[{"name":"DemosJarco","email":"1209494+demosjarco@users.noreply.github.com"},{"name":"Sam Gammon","email":"sam@elide.dev"}],"license":"MIT","bugs":{"url":"https://github.com/autosec-network/FetchHole/issues"},"homepage":"https://github.com/autosec-network/FetchHole#readme","engines":{"node":">=16.15.0"},"publishConfig":{"access":"public"},"exports":{".":"./dist/index.mjs"},"imports":{".":{"default":"./dist/index.mjs","types":"./dist/index.d.mts"}},"prettier":"@demosjarco/prettier-config","dependencies":{"chalk":"^5.3.0","dns-packet":"^5.6.1"},"devDependencies":{"@demosjarco/prettier-config":"^1.0.1","@swc/core":"^1.3.99","@types/dns-packet":"^5.6.4","@types/node":"^20.9.2","prettier":"^3.1.0","ts-node":"^10.9.1","typescript":"^5.3.2"},"_id":"@autosec/fetchhole@0.1.1-nightly.3","readme":"[![License](https://img.shields.io/github/license/autosec-network/FetchHole)](LICENSE)\n[![TypeScript](https://badgen.net/npm/types/@autosec-network/FetchHole)](https://www.npmjs.com/package/@autosec/fetchhole)\n[![npm](https://img.shields.io/npm/v/@autosec-network/FetchHole)](https://www.npmjs.com/package/@autosec/fetchhole)\n[![npm](https://img.shields.io/npm/dm/@autosec-network/FetchHole)](https://www.npmjs.com/package/@autosec/fetchhole)\n[![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/autosec-network/FetchHole/badge)](https://securityscorecards.dev/viewer/?uri=github.com/autosec-network/FetchHole)\n[![Socket Badge](https://socket.dev/api/badge/npm/package/@autosec-network/FetchHole)](https://socket.dev/npm/package/@autosec-network/FetchHole)\n\n# FetchHole\n\nElevate your Function as a Service (FaaS) development with enhanced security at the edge using `@autosec/fetchhole`. This package acts as a sophisticated drop-in replacement for the native `fetch()` function, tailored for developers who emphasize security in their web applications.\n\n## Features\n\n-   **Drop-in Replacement**: Seamlessly integrates with existing code, replacing the native `fetch()` function.\n-   **Advanced Logging**: Comprehensive logging capabilities for effective debugging.\n-   **Redirect Intercept**: Customize redirect limits with a default of 20, as per the WHATWG Fetch specification.\n-   **Header Computation**: Automatically computes and adds missing `Content-Length` and `ETag` headers. Choose your preferred ETag hash algorithm, with `sha256` as the default.\n-   **Cache Support**: Utilizes memory or disk caching via the Cache Web API. Compatible with Cloudflare's cache API for Cloudflare users.\n-   **Intercept for Alternate Routing**: Ideal for scenarios like Cloudflare Workers Binding, allowing for alternate request routing.\n-   **Custom DNS Resolver Support**: Designed for DNS level security applications like Zero Trust services. Compatible with any DoH resolver that uses `0.0.0.0` for blocking.\n    -   **Direct IP Address Handling**: Offers three modes for handling direct IP address access:\n        -   Full Block\n        -   Fail if No PTR Record (conducts a PTR record check, followed by a standard DNS check)\n        -   Allow\n\n## Supported Environments\n\n-   [x] NodeJS v16.15.0 or later (that's when NodeJS got native `fetch()` support) environments\n-   [ ] Browser support\n-   [x] Cloudflare Workers/Pages with `compatibility_flags = [ \"nodejs_compat\" ]` (not to be confused with `node_compat = true`)\n    > [!NOTE]\n    > When Browser support lands, it's still recommended to use `nodejs_compat` because those apis run faster and are more robust\n\n## Installation\n\n```bash\nnpm install @autosec/fetchhole\n```\n\n## Usage\n\nSimply import fetchhole and use it as a replacement for the native fetch() function.\n\n```ts\n// TODO\n```\n\n## Configuration\n\nYou can customize fetchhole with various options to suit your needs. Settings can be applied at the class instance level or as an fetch init property:\n\n```ts\n{\n\tcache: {\n\t\ttype: CacheType.Default, // Defines cache type\n\t\thashAlgorithm: 'sha256', // Choose a different ETag hash algorithm\n\t\tignoreMethod: false,\n\t\tignoreSearch: false,\n\t\tignoreVary: false,\n\t},\n\thardFail: true, // Determines failure handling\n\tlogLevel: LoggingLevel.INFO, // Sets the level of logging\n\tredirectCount: 20, // Set custom redirect limit\n}\n```\n","readmeFilename":"README.md","gitHead":"b8da6977164168b45e15d7ef2e136933d460bf4e","_nodeVersion":"20.10.0","_npmVersion":"10.2.3","dist":{"integrity":"sha512-qVF7p+apRfvOwGJXeQ07zLLvp1x8NCDyR1bc/BZDxZQHxFWXI9ruSDKp642Hd8Bsmhq5V1TOo+szgFTny2mhNQ==","shasum":"eddc9d51fbf730092320837085e7b3c30ca71d63","tarball":"https://registry.npmjs.org/@autosec/fetchhole/-/fetchhole-0.1.1-nightly.3.tgz","fileCount":20,"unpackedSize":43535,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@autosec%2ffetchhole@0.1.1-nightly.3","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBGfMFu9qkTktQN9dPQYLzqMNnATATKCNpMi5tCiPYaFAiBSEHsyoaWNvZ82V7jimeNnlGwF4x9aWlBQG1fqd1LosA=="}]},"_npmUser":{"name":"demosjarco","email":"demosjarco@protonmail.com"},"directories":{},"maintainers":[{"name":"demosjarco","email":"demosjarco@protonmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetchhole_0.1.1-nightly.3_1702685086201_0.7982031840803239"},"_hasShrinkwrap":false},"0.1.1-nightly.4":{"name":"@autosec/fetchhole","version":"0.1.1-nightly.4","description":"Boost your FaaS development with fetchhole, a secure, drop-in replacement for the native `fetch()` function, designed for security-focused web developers.","type":"module","main":"./dist/index.mjs","types":"./dist/index.d.mts","scripts":{"build":"tsc","build:watch":"npm run build -- --watch","test":"node --loader ts-node/esm --test --test-reporter=spec"},"repository":{"type":"git","url":"git+https://github.com/autosec-network/FetchHole.git"},"author":{"name":"Autosec"},"contributors":[{"name":"DemosJarco","email":"1209494+demosjarco@users.noreply.github.com"},{"name":"Sam Gammon","email":"sam@elide.dev"}],"license":"MIT","bugs":{"url":"https://github.com/autosec-network/FetchHole/issues"},"homepage":"https://github.com/autosec-network/FetchHole#readme","engines":{"node":">=16.15.0"},"publishConfig":{"access":"public"},"exports":{".":"./dist/index.mjs"},"imports":{".":{"default":"./dist/index.mjs","types":"./dist/index.d.mts"}},"prettier":"@demosjarco/prettier-config","dependencies":{"chalk":"^5.3.0","dns-packet":"^5.6.1"},"devDependencies":{"@demosjarco/prettier-config":"^1.0.1","@swc/core":"^1.3.99","@types/dns-packet":"^5.6.4","@types/node":"^20.9.2","prettier":"^3.1.0","ts-node":"^10.9.1","typescript":"^5.3.2"},"_id":"@autosec/fetchhole@0.1.1-nightly.4","readme":"[![License](https://img.shields.io/github/license/autosec-network/FetchHole)](LICENSE)\n[![TypeScript](https://badgen.net/npm/types/@autosec-network/FetchHole)](https://www.npmjs.com/package/@autosec/fetchhole)\n[![npm](https://img.shields.io/npm/v/@autosec-network/FetchHole)](https://www.npmjs.com/package/@autosec/fetchhole)\n[![npm](https://img.shields.io/npm/dm/@autosec-network/FetchHole)](https://www.npmjs.com/package/@autosec/fetchhole)\n[![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/autosec-network/FetchHole/badge)](https://securityscorecards.dev/viewer/?uri=github.com/autosec-network/FetchHole)\n[![Socket Badge](https://socket.dev/api/badge/npm/package/@autosec-network/FetchHole)](https://socket.dev/npm/package/@autosec-network/FetchHole)\n\n# FetchHole\n\nElevate your Function as a Service (FaaS) development with enhanced security at the edge using `@autosec/fetchhole`. This package acts as a sophisticated drop-in replacement for the native `fetch()` function, tailored for developers who emphasize security in their web applications.\n\n## Features\n\n-   **Drop-in Replacement**: Seamlessly integrates with existing code, replacing the native `fetch()` function.\n-   **Advanced Logging**: Comprehensive logging capabilities for effective debugging.\n-   **Redirect Intercept**: Customize redirect limits with a default of 20, as per the WHATWG Fetch specification.\n-   **Header Computation**: Automatically computes and adds missing `Content-Length` and `ETag` headers. Choose your preferred ETag hash algorithm, with `sha256` as the default.\n-   **Cache Support**: Utilizes memory or disk caching via the Cache Web API. Compatible with Cloudflare's cache API for Cloudflare users.\n-   **Intercept for Alternate Routing**: Ideal for scenarios like Cloudflare Workers Binding, allowing for alternate request routing.\n-   **Custom DNS Resolver Support**: Designed for DNS level security applications like Zero Trust services. Compatible with any DoH resolver that uses `0.0.0.0` for blocking.\n    -   **Direct IP Address Handling**: Offers three modes for handling direct IP address access:\n        -   Full Block\n        -   Fail if No PTR Record (conducts a PTR record check, followed by a standard DNS check)\n        -   Allow\n\n## Supported Environments\n\n-   [x] NodeJS v16.15.0 or later (that's when NodeJS got native `fetch()` support) environments\n-   [ ] Browser support\n-   [x] Cloudflare Workers/Pages with `compatibility_flags = [ \"nodejs_compat\" ]` (not to be confused with `node_compat = true`)\n    > [!NOTE]\n    > When Browser support lands, it's still recommended to use `nodejs_compat` because those apis run faster and are more robust\n\n## Installation\n\n```bash\nnpm install @autosec/fetchhole\n```\n\n## Usage\n\nSimply import fetchhole and use it as a replacement for the native fetch() function.\n\n```ts\n// TODO\n```\n\n## Configuration\n\nYou can customize fetchhole with various options to suit your needs. Settings can be applied at the class instance level or as an fetch init property:\n\n```ts\n{\n\tcache: {\n\t\ttype: CacheType.Default, // Defines cache type\n\t\thashAlgorithm: 'sha256', // Choose a different ETag hash algorithm\n\t\tignoreMethod: false,\n\t\tignoreSearch: false,\n\t\tignoreVary: false,\n\t},\n\tdohServer: {\n\t\tprovider: 'https://dns.quad9.net/dns-query', // The server used to run security check\n\t\textraHeaders: new Headers(), // Other headers needed by DoH server other than required by RFC 8484\n\t\ttimeout: 2 * 1000, // Timeout in milliseconds to wait for a DNS query to resolve\n\t},\n\thardFail: true, // Determines failure handling\n\tip: {\n\t\tpolicy: IPBlockMode.BlockIfNxPTR,\n\t\tptrDohServer: {\n\t\t\tprovider: 'https://dns.google/dns-query', // The server used to perform PTR lookups, not security checks\n\t\t\textraHeaders: new Headers(), // Other headers needed by DoH server other than required by RFC 8484\n\t\t\ttimeout: 2 * 1000, // Timeout in milliseconds to wait for a DNS query to resolve\n\t\t},\n\t},\n\tlogLevel: LoggingLevel.INFO, // Sets the level of logging\n\tredirectCount: 20, // Set custom redirect limit\n}\n```\n","readmeFilename":"README.md","gitHead":"3075c94a18a4756fc89081613183b43949417168","_nodeVersion":"20.10.0","_npmVersion":"10.2.3","dist":{"integrity":"sha512-JP0jCJpOooJ08queVXe6H+Gvnr1Hv+9viTJ0pH0UZ7DkWVUnc5tQQl0uz4/pdKVFynsrrfmHe/gPVSM6v6yHtg==","shasum":"5030fe811f97b5f2f4e25cba6ddadcd18fed435a","tarball":"https://registry.npmjs.org/@autosec/fetchhole/-/fetchhole-0.1.1-nightly.4.tgz","fileCount":20,"unpackedSize":45213,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@autosec%2ffetchhole@0.1.1-nightly.4","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEDqD0Kue6MNoMJ7PUk5iyrlPVfuobybcSzr9fdPqnf6AiEA8kB0q91hqJOjG9OFYjBfizd4WAJzrRd5N7G2IGTHuPg="}]},"_npmUser":{"name":"demosjarco","email":"demosjarco@protonmail.com"},"directories":{},"maintainers":[{"name":"demosjarco","email":"demosjarco@protonmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetchhole_0.1.1-nightly.4_1702689736896_0.3010699539789752"},"_hasShrinkwrap":false},"0.1.1-nightly.6":{"name":"@autosec/fetchhole","version":"0.1.1-nightly.6","description":"Boost your FaaS development with fetchhole, a secure, drop-in replacement for the native `fetch()` function, designed for security-focused web developers.","type":"module","main":"./dist/index.mjs","types":"./dist/index.d.mts","scripts":{"build":"tsc","build:watch":"npm run build -- --watch","test":"node --loader ts-node/esm --test --test-reporter=spec"},"repository":{"type":"git","url":"git+https://github.com/autosec-network/FetchHole.git"},"author":{"name":"Autosec"},"contributors":[{"name":"DemosJarco","email":"1209494+demosjarco@users.noreply.github.com"},{"name":"Sam Gammon","email":"sam@elide.dev"}],"license":"MIT","bugs":{"url":"https://github.com/autosec-network/FetchHole/issues"},"homepage":"https://github.com/autosec-network/FetchHole#readme","engines":{"node":">=16.15.0"},"publishConfig":{"access":"public"},"exports":{".":"./dist/index.mjs"},"imports":{".":{"default":"./dist/index.mjs","types":"./dist/index.d.mts"}},"prettier":"@demosjarco/prettier-config","dependencies":{"chalk":"^5.3.0","dns-packet":"^5.6.1"},"devDependencies":{"@demosjarco/prettier-config":"^1.0.1","@swc/core":"^1.3.99","@types/dns-packet":"^5.6.4","@types/node":"^20.9.2","prettier":"^3.1.0","ts-node":"^10.9.1","typescript":"^5.3.2"},"_id":"@autosec/fetchhole@0.1.1-nightly.6","readme":"[![License](https://img.shields.io/github/license/autosec-network/FetchHole)](LICENSE)\n[![TypeScript](https://badgen.net/npm/types/@autosec-network/FetchHole)](https://www.npmjs.com/package/@autosec/fetchhole)\n[![npm](https://img.shields.io/npm/v/@autosec-network/FetchHole)](https://www.npmjs.com/package/@autosec/fetchhole)\n[![npm](https://img.shields.io/npm/dm/@autosec-network/FetchHole)](https://www.npmjs.com/package/@autosec/fetchhole)\n[![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/autosec-network/FetchHole/badge)](https://securityscorecards.dev/viewer/?uri=github.com/autosec-network/FetchHole)\n[![Socket Badge](https://socket.dev/api/badge/npm/package/@autosec-network/FetchHole)](https://socket.dev/npm/package/@autosec-network/FetchHole)\n\n# FetchHole\n\nElevate your Function as a Service (FaaS) development with enhanced security at the edge using `@autosec/fetchhole`. This package acts as a sophisticated drop-in replacement for the native `fetch()` function, tailored for developers who emphasize security in their web applications.\n\n## Features\n\n-   **Drop-in Replacement**: Seamlessly integrates with existing code, replacing the native `fetch()` function.\n-   **Advanced Logging**: Comprehensive logging capabilities for effective debugging.\n-   **Redirect Intercept**: Customize redirect limits with a default of 20, as per the WHATWG Fetch specification.\n-   **Header Computation**: Automatically computes and adds missing `Content-Length` and `ETag` headers. Choose your preferred ETag hash algorithm, with `sha256` as the default.\n-   **Cache Support**: Utilizes memory or disk caching via the Cache Web API. Compatible with Cloudflare's cache API for Cloudflare users.\n-   **Intercept for Alternate Routing**: Ideal for scenarios like Cloudflare Workers Binding, allowing for alternate request routing.\n-   **Custom DNS Resolver Support**: Designed for DNS level security applications like Zero Trust services. Compatible with any DoH resolver that uses `0.0.0.0` for blocking.\n    -   **Direct IP Address Handling**: Offers three modes for handling direct IP address access:\n        -   Full Block\n        -   Fail if No PTR Record (conducts a PTR record check, followed by a standard DNS check)\n        -   Allow\n\n## Supported Environments\n\n-   [x] NodeJS v16.15.0 or later (that's when NodeJS got native `fetch()` support) environments\n-   [ ] Browser support\n-   [x] Cloudflare Workers/Pages with `compatibility_flags = [ \"nodejs_compat\" ]` (not to be confused with `node_compat = true`)\n    > [!NOTE]\n    > When Browser support lands, it's still recommended to use `nodejs_compat` because those apis run faster and are more robust\n\n## Installation\n\n```bash\nnpm install @autosec/fetchhole\n```\n\n## Usage\n\nSimply import fetchhole and use it as a replacement for the native fetch() function.\n\n```ts\n// TODO\n```\n\n## Configuration\n\nYou can customize fetchhole with various options to suit your needs. Settings can be applied at the class instance level or as an fetch init property:\n\n```ts\n{\n\tcache: {\n\t\ttype: CacheType.Default, // Defines cache type\n\t\thashAlgorithm: 'sha256', // Choose a different ETag hash algorithm\n\t\tignoreMethod: false,\n\t\tignoreSearch: false,\n\t\tignoreVary: false,\n\t},\n\tdohServer: {\n\t\tprovider: 'https://dns.quad9.net/dns-query', // The server used to run security check\n\t\textraHeaders: new Headers(), // Other headers needed by DoH server other than required by RFC 8484\n\t\ttimeout: 2 * 1000, // Timeout in milliseconds to wait for a DNS query to resolve\n\t},\n\thardFail: true, // Determines failure handling\n\tip: {\n\t\tpolicy: IPBlockMode.BlockIfNxPTR,\n\t\tptrDohServer: {\n\t\t\tprovider: 'https://dns.google/dns-query', // The server used to perform PTR lookups, not security checks\n\t\t\textraHeaders: new Headers(), // Other headers needed by DoH server other than required by RFC 8484\n\t\t\ttimeout: 2 * 1000, // Timeout in milliseconds to wait for a DNS query to resolve\n\t\t},\n\t},\n\tlogLevel: LoggingLevel.INFO, // Sets the level of logging\n\tredirectCount: 20, // Set custom redirect limit\n}\n```\n","readmeFilename":"README.md","gitHead":"b2db35642fc1c7156b86c3f366d0fa4e8fb7a29c","_nodeVersion":"20.10.0","_npmVersion":"10.2.3","dist":{"integrity":"sha512-9bSz8EYob64zF2SpJ9RudFiH6H5UVnS11xpLvX50XuK9m+xZgXFvzdGgwpN3nXCtlyvsUlP9Mp2+pA7UB9lqJg==","shasum":"cfba9624a528cd68e28728f00b1b1735f02296a4","tarball":"https://registry.npmjs.org/@autosec/fetchhole/-/fetchhole-0.1.1-nightly.6.tgz","fileCount":20,"unpackedSize":46169,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@autosec%2ffetchhole@0.1.1-nightly.6","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAXsTEbNqvEJwzv4mT5JMmAiGcnOWMJhaKFJAruPGOeFAiArM3NvzAvpcpfXKavgnU83wPxUqe/EUuOq9+bVS5SBUQ=="}]},"_npmUser":{"name":"demosjarco","email":"demosjarco@protonmail.com"},"directories":{},"maintainers":[{"name":"demosjarco","email":"demosjarco@protonmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetchhole_0.1.1-nightly.6_1703030842685_0.6709488920099784"},"_hasShrinkwrap":false},"0.1.1-beta.0":{"name":"@autosec/fetchhole","version":"0.1.1-beta.0","description":"Boost your FaaS development with fetchhole, a secure, drop-in replacement for the native `fetch()` function, designed for security-focused web developers.","type":"module","main":"./dist/index.mjs","types":"./dist/index.d.mts","scripts":{"build":"tsc","build:watch":"npm run build -- --watch","test":"node --loader ts-node/esm --test --test-reporter=spec"},"repository":{"type":"git","url":"git+https://github.com/autosec-network/FetchHole.git"},"author":{"name":"Autosec"},"contributors":[{"name":"DemosJarco","email":"1209494+demosjarco@users.noreply.github.com"},{"name":"Sam Gammon","email":"sam@elide.dev"}],"license":"MIT","bugs":{"url":"https://github.com/autosec-network/FetchHole/issues"},"homepage":"https://github.com/autosec-network/FetchHole#readme","engines":{"node":">=16.15.0"},"publishConfig":{"access":"public"},"exports":{".":"./dist/index.mjs"},"imports":{".":{"default":"./dist/index.mjs","types":"./dist/index.d.mts"}},"prettier":"@demosjarco/prettier-config","dependencies":{"chalk":"^5.3.0","dns-packet":"^5.6.1"},"devDependencies":{"@demosjarco/prettier-config":"^1.0.1","@swc/core":"^1.3.99","@types/dns-packet":"^5.6.4","@types/node":"^20.9.2","prettier":"^3.1.0","ts-node":"^10.9.1","typescript":"^5.3.2"},"_id":"@autosec/fetchhole@0.1.1-beta.0","readme":"[![License](https://img.shields.io/github/license/autosec-network/FetchHole)](LICENSE)\n[![TypeScript](https://badgen.net/npm/types/@autosec-network/FetchHole)](https://www.npmjs.com/package/@autosec/fetchhole)\n[![npm](https://img.shields.io/npm/v/@autosec-network/FetchHole)](https://www.npmjs.com/package/@autosec/fetchhole)\n[![npm](https://img.shields.io/npm/dm/@autosec-network/FetchHole)](https://www.npmjs.com/package/@autosec/fetchhole)\n[![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/autosec-network/FetchHole/badge)](https://securityscorecards.dev/viewer/?uri=github.com/autosec-network/FetchHole)\n[![Socket Badge](https://socket.dev/api/badge/npm/package/@autosec-network/FetchHole)](https://socket.dev/npm/package/@autosec-network/FetchHole)\n\n# FetchHole\n\nElevate your Function as a Service (FaaS) development with enhanced security at the edge using `@autosec/fetchhole`. This package acts as a sophisticated drop-in replacement for the native `fetch()` function, tailored for developers who emphasize security in their web applications.\n\n## Features\n\n-   **Drop-in Replacement**: Seamlessly integrates with existing code, replacing the native `fetch()` function.\n-   **Advanced Logging**: Comprehensive logging capabilities for effective debugging.\n-   **Redirect Intercept**: Customize redirect limits with a default of 20, as per the WHATWG Fetch specification.\n-   **Header Computation**: Automatically computes and adds missing `Content-Length` and `ETag` headers. Choose your preferred ETag hash algorithm, with `sha256` as the default.\n-   **Cache Support**: Utilizes memory or disk caching via the Cache Web API. Compatible with Cloudflare's cache API for Cloudflare users.\n-   **Intercept for Alternate Routing**: Ideal for scenarios like Cloudflare Workers Binding, allowing for alternate request routing.\n-   **Custom DNS Resolver Support**: Designed for DNS level security applications like Zero Trust services. Compatible with any DoH resolver that uses `0.0.0.0` for blocking.\n    -   **Direct IP Address Handling**: Offers three modes for handling direct IP address access:\n        -   Full Block\n        -   Fail if No PTR Record (conducts a PTR record check, followed by a standard DNS check)\n        -   Allow\n\n## Supported Environments\n\n-   [x] NodeJS v16.15.0 or later (that's when NodeJS got native `fetch()` support) environments\n-   [ ] Browser support\n-   [x] Cloudflare Workers/Pages with `compatibility_flags = [ \"nodejs_compat\" ]` (not to be confused with `node_compat = true`)\n    > [!NOTE]\n    > When Browser support lands, it's still recommended to use `nodejs_compat` because those apis run faster and are more robust\n\n## Installation\n\n```bash\nnpm install @autosec/fetchhole\n```\n\n## Usage\n\nSimply import fetchhole and use it as a replacement for the native fetch() function.\n\n```ts\n// TODO\n```\n\n## Configuration\n\nYou can customize fetchhole with various options to suit your needs. Settings can be applied at the class instance level or as an fetch init property:\n\n```ts\n{\n\tcache: {\n\t\ttype: CacheType.Default, // Defines cache type\n\t\thashAlgorithm: 'sha256', // Choose a different ETag hash algorithm\n\t\tignoreMethod: false,\n\t\tignoreSearch: false,\n\t\tignoreVary: false,\n\t},\n\tdohServer: {\n\t\tprovider: 'https://dns.quad9.net/dns-query', // The server used to run security check\n\t\textraHeaders: new Headers(), // Other headers needed by DoH server other than required by RFC 8484\n\t\ttimeout: 2 * 1000, // Timeout in milliseconds to wait for a DNS query to resolve\n\t},\n\thardFail: true, // Determines failure handling\n\tip: {\n\t\tpolicy: IPBlockMode.BlockIfNxPTR,\n\t\tptrDohServer: {\n\t\t\tprovider: 'https://dns.google/dns-query', // The server used to perform PTR lookups, not security checks\n\t\t\textraHeaders: new Headers(), // Other headers needed by DoH server other than required by RFC 8484\n\t\t\ttimeout: 2 * 1000, // Timeout in milliseconds to wait for a DNS query to resolve\n\t\t},\n\t},\n\tlogLevel: LoggingLevel.INFO, // Sets the level of logging\n\tredirectCount: 20, // Set custom redirect limit\n}\n```\n","readmeFilename":"README.md","gitHead":"0e9c229aed42dd348316c74bd5c83384fb92e4f2","_nodeVersion":"20.10.0","_npmVersion":"10.2.3","dist":{"integrity":"sha512-2nHwxizw3np2rIoMZd1Duzn6oITu436npEQDKTOBkEJyu94nsUw12gf1RGXX2ztMnGiSk7BReN17EuHSH8ENDA==","shasum":"22ebd103777b78e9c1a401a62fb1d6993af99e78","tarball":"https://registry.npmjs.org/@autosec/fetchhole/-/fetchhole-0.1.1-beta.0.tgz","fileCount":20,"unpackedSize":46166,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@autosec%2ffetchhole@0.1.1-beta.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC0iMeehK2xJuflsOizhKF4sZglAsA0swpZZeOMlzQxCwIgMSvYhf5Ut/0CIItaVA31GCmhmuR8xxw6/QZzYNc7ftk="}]},"_npmUser":{"name":"demosjarco","email":"demosjarco@protonmail.com"},"directories":{},"maintainers":[{"name":"demosjarco","email":"demosjarco@protonmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetchhole_0.1.1-beta.0_1703031463700_0.5147660588689746"},"_hasShrinkwrap":false},"0.1.1-beta.1":{"name":"@autosec/fetchhole","version":"0.1.1-beta.1","description":"Boost your FaaS development with fetchhole, a secure, drop-in replacement for the native `fetch()` function, designed for security-focused web developers.","type":"module","main":"./dist/index.mjs","types":"./dist/index.d.mts","scripts":{"build":"tsc","build:watch":"npm run build -- --watch","test":"node --loader ts-node/esm --test --test-reporter=spec"},"repository":{"type":"git","url":"git+https://github.com/autosec-network/FetchHole.git"},"author":{"name":"Autosec"},"contributors":[{"name":"DemosJarco","email":"1209494+demosjarco@users.noreply.github.com"},{"name":"Sam Gammon","email":"sam@elide.dev"}],"license":"MIT","bugs":{"url":"https://github.com/autosec-network/FetchHole/issues"},"homepage":"https://github.com/autosec-network/FetchHole#readme","engines":{"node":">=16.15.0"},"publishConfig":{"access":"public"},"exports":{".":"./dist/index.mjs"},"imports":{".":{"default":"./dist/index.mjs","types":"./dist/index.d.mts"}},"prettier":"@demosjarco/prettier-config","dependencies":{"chalk":"^5.3.0","dns-packet":"^5.6.1"},"devDependencies":{"@demosjarco/prettier-config":"^1.0.1","@swc/core":"^1.3.99","@types/dns-packet":"^5.6.4","@types/node":"^20.9.2","prettier":"^3.1.0","ts-node":"^10.9.1","typescript":"^5.3.2"},"_id":"@autosec/fetchhole@0.1.1-beta.1","readme":"[![License](https://img.shields.io/github/license/autosec-network/FetchHole)](LICENSE)\n[![TypeScript](https://badgen.net/npm/types/@autosec-network/FetchHole)](https://www.npmjs.com/package/@autosec/fetchhole)\n[![npm](https://img.shields.io/npm/v/@autosec-network/FetchHole)](https://www.npmjs.com/package/@autosec/fetchhole)\n[![npm](https://img.shields.io/npm/dm/@autosec-network/FetchHole)](https://www.npmjs.com/package/@autosec/fetchhole)\n[![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/autosec-network/FetchHole/badge)](https://securityscorecards.dev/viewer/?uri=github.com/autosec-network/FetchHole)\n[![Socket Badge](https://socket.dev/api/badge/npm/package/@autosec-network/FetchHole)](https://socket.dev/npm/package/@autosec-network/FetchHole)\n\n# FetchHole\n\nElevate your Function as a Service (FaaS) development with enhanced security at the edge using `@autosec/fetchhole`. This package acts as a sophisticated drop-in replacement for the native `fetch()` function, tailored for developers who emphasize security in their web applications.\n\n## Features\n\n-   **Drop-in Replacement**: Seamlessly integrates with existing code, replacing the native `fetch()` function.\n-   **Advanced Logging**: Comprehensive logging capabilities for effective debugging.\n-   **Redirect Intercept**: Customize redirect limits with a default of 20, as per the WHATWG Fetch specification.\n-   **Header Computation**: Automatically computes and adds missing `Content-Length` and `ETag` headers. Choose your preferred ETag hash algorithm, with `sha256` as the default.\n-   **Cache Support**: Utilizes memory or disk caching via the Cache Web API. Compatible with Cloudflare's cache API for Cloudflare users.\n-   **Intercept for Alternate Routing**: Ideal for scenarios like Cloudflare Workers Binding, allowing for alternate request routing.\n-   **Custom DNS Resolver Support**: Designed for DNS level security applications like Zero Trust services. Compatible with any DoH resolver that uses `0.0.0.0` for blocking.\n    -   **Direct IP Address Handling**: Offers three modes for handling direct IP address access:\n        -   Full Block\n        -   Fail if No PTR Record (conducts a PTR record check, followed by a standard DNS check)\n        -   Allow\n\n## Supported Environments\n\n-   [x] NodeJS v16.15.0 or later (that's when NodeJS got native `fetch()` support) environments\n-   [ ] Browser support\n-   [x] Cloudflare Workers/Pages with `compatibility_flags = [ \"nodejs_compat\" ]` (not to be confused with `node_compat = true`)\n    > [!NOTE]\n    > When Browser support lands, it's still recommended to use `nodejs_compat` because those apis run faster and are more robust\n\n## Installation\n\n```bash\nnpm install @autosec/fetchhole\n```\n\n## Usage\n\nSimply import fetchhole and use it as a replacement for the native fetch() function.\n\n```ts\n// TODO\n```\n\n## Configuration\n\nYou can customize fetchhole with various options to suit your needs. Settings can be applied at the class instance level or as an fetch init property:\n\n```ts\n{\n\tcache: {\n\t\ttype: CacheType.Default, // Defines cache type\n\t\thashAlgorithm: 'sha256', // Choose a different ETag hash algorithm\n\t\tignoreMethod: false,\n\t\tignoreSearch: false,\n\t\tignoreVary: false,\n\t},\n\tdohServer: {\n\t\tprovider: 'https://dns.quad9.net/dns-query', // The server used to run security check\n\t\textraHeaders: new Headers(), // Other headers needed by DoH server other than required by RFC 8484\n\t\ttimeout: 2 * 1000, // Timeout in milliseconds to wait for a DNS query to resolve\n\t},\n\thardFail: true, // Determines failure handling\n\tip: {\n\t\tpolicy: IPBlockMode.BlockIfNxPTR,\n\t\tptrDohServer: {\n\t\t\tprovider: 'https://dns.google/dns-query', // The server used to perform PTR lookups, not security checks\n\t\t\textraHeaders: new Headers(), // Other headers needed by DoH server other than required by RFC 8484\n\t\t\ttimeout: 2 * 1000, // Timeout in milliseconds to wait for a DNS query to resolve\n\t\t},\n\t},\n\tlogLevel: LoggingLevel.INFO, // Sets the level of logging\n\tredirectCount: 20, // Set custom redirect limit\n}\n```\n","readmeFilename":"README.md","gitHead":"7464387e6f265d5787eefa9ae7734ebaa9ee9514","_nodeVersion":"20.10.0","_npmVersion":"10.2.3","dist":{"integrity":"sha512-5JOf+NOJVgdUJEFNLFItr50Muz0cMdeoEV7hUjZTLr1aWKysrDyx5vwDL3CzGL83+OB8ZCiX1eKYxaJfCa0VHQ==","shasum":"587b03de72eba1931af618dd332682835a003a6b","tarball":"https://registry.npmjs.org/@autosec/fetchhole/-/fetchhole-0.1.1-beta.1.tgz","fileCount":20,"unpackedSize":46166,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@autosec%2ffetchhole@0.1.1-beta.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDteTMHfr9veCkz/pKy0WRflEgqNs6XZls3kSeuHBkVbAIhAL99p7A7QB+Y3IjMwOp2TBMcOBvCV6RrdP36tq7pIVzu"}]},"_npmUser":{"name":"demosjarco","email":"demosjarco@protonmail.com"},"directories":{},"maintainers":[{"name":"demosjarco","email":"demosjarco@protonmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetchhole_0.1.1-beta.1_1703032778910_0.9713764491018033"},"_hasShrinkwrap":false},"0.1.1-nightly.7":{"name":"@autosec/fetchhole","version":"0.1.1-nightly.7","description":"Boost your FaaS development with fetchhole, a secure, drop-in replacement for the native `fetch()` function, designed for security-focused web developers.","type":"module","main":"./dist/index.mjs","types":"./dist/index.d.mts","scripts":{"build":"tsc","build:watch":"npm run build -- --watch","test":"node --loader ts-node/esm --test --test-reporter=spec"},"repository":{"type":"git","url":"git+https://github.com/autosec-network/FetchHole.git"},"author":{"name":"Autosec"},"contributors":[{"name":"DemosJarco","email":"1209494+demosjarco@users.noreply.github.com"},{"name":"Sam Gammon","email":"sam@elide.dev"}],"license":"MIT","bugs":{"url":"https://github.com/autosec-network/FetchHole/issues"},"homepage":"https://github.com/autosec-network/FetchHole#readme","engines":{"node":">=16.15.0"},"publishConfig":{"access":"public"},"exports":{".":"./dist/index.mjs"},"imports":{".":{"default":"./dist/index.mjs","types":"./dist/index.d.mts"}},"prettier":"@demosjarco/prettier-config","dependencies":{"chalk":"^5.3.0","dns-packet":"^5.6.1"},"devDependencies":{"@demosjarco/prettier-config":"^1.0.1","@swc/core":"^1.3.99","@types/dns-packet":"^5.6.4","@types/node":"^20.9.2","prettier":"^3.1.0","ts-node":"^10.9.1","typescript":"^5.3.2"},"_id":"@autosec/fetchhole@0.1.1-nightly.7","readme":"[![License](https://img.shields.io/github/license/autosec-network/FetchHole)](LICENSE)\n[![TypeScript](https://badgen.net/npm/types/@autosec-network/FetchHole)](https://www.npmjs.com/package/@autosec/fetchhole)\n[![npm](https://img.shields.io/npm/v/@autosec-network/FetchHole)](https://www.npmjs.com/package/@autosec/fetchhole)\n[![npm](https://img.shields.io/npm/dm/@autosec-network/FetchHole)](https://www.npmjs.com/package/@autosec/fetchhole)\n[![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/autosec-network/FetchHole/badge)](https://securityscorecards.dev/viewer/?uri=github.com/autosec-network/FetchHole)\n[![Socket Badge](https://socket.dev/api/badge/npm/package/@autosec-network/FetchHole)](https://socket.dev/npm/package/@autosec-network/FetchHole)\n\n# FetchHole\n\nElevate your Function as a Service (FaaS) development with enhanced security at the edge using `@autosec/fetchhole`. This package acts as a sophisticated drop-in replacement for the native `fetch()` function, tailored for developers who emphasize security in their web applications.\n\n## Features\n\n-   **Drop-in Replacement**: Seamlessly integrates with existing code, replacing the native `fetch()` function.\n-   **Advanced Logging**: Comprehensive logging capabilities for effective debugging.\n-   **Redirect Intercept**: Customize redirect limits with a default of 20, as per the WHATWG Fetch specification.\n-   **Header Computation**: Automatically computes and adds missing `Content-Length` and `ETag` headers. Choose your preferred ETag hash algorithm, with `sha256` as the default.\n-   **Cache Support**: Utilizes memory or disk caching via the Cache Web API. Compatible with Cloudflare's cache API for Cloudflare users.\n-   **Intercept for Alternate Routing**: Ideal for scenarios like Cloudflare Workers Binding, allowing for alternate request routing.\n-   **Custom DNS Resolver Support**: Designed for DNS level security applications like Zero Trust services. Compatible with any DoH resolver that uses `0.0.0.0` for blocking.\n    -   **Direct IP Address Handling**: Offers three modes for handling direct IP address access:\n        -   Full Block\n        -   Fail if No PTR Record (conducts a PTR record check, followed by a standard DNS check)\n        -   Allow\n\n## Supported Environments\n\n-   [x] NodeJS v16.15.0 or later (that's when NodeJS got native `fetch()` support) environments\n-   [ ] Browser support\n-   [x] Cloudflare Workers/Pages with `compatibility_flags = [ \"nodejs_compat\" ]` (not to be confused with `node_compat = true`)\n    > [!NOTE]\n    > When Browser support lands, it's still recommended to use `nodejs_compat` because those apis run faster and are more robust\n\n## Installation\n\n```bash\nnpm install @autosec/fetchhole\n```\n\n## Usage\n\nSimply import fetchhole and use it as a replacement for the native fetch() function.\n\n```ts\n// TODO\n```\n\n## Configuration\n\nYou can customize fetchhole with various options to suit your needs. Settings can be applied at the class instance level or as an fetch init property:\n\n```ts\n{\n\tcache: {\n\t\ttype: CacheType.Default, // Defines cache type\n\t\thashAlgorithm: 'sha256', // Choose a different ETag hash algorithm\n\t\tignoreMethod: false,\n\t\tignoreSearch: false,\n\t\tignoreVary: false,\n\t},\n\tdohServer: {\n\t\tprovider: 'https://dns.quad9.net/dns-query', // The server used to run security check\n\t\textraHeaders: new Headers(), // Other headers needed by DoH server other than required by RFC 8484\n\t\ttimeout: 2 * 1000, // Timeout in milliseconds to wait for a DNS query to resolve\n\t},\n\thardFail: true, // Determines failure handling\n\tip: {\n\t\tpolicy: IPBlockMode.BlockIfNxPTR,\n\t\tptrDohServer: {\n\t\t\tprovider: 'https://dns.google/dns-query', // The server used to perform PTR lookups, not security checks\n\t\t\textraHeaders: new Headers(), // Other headers needed by DoH server other than required by RFC 8484\n\t\t\ttimeout: 2 * 1000, // Timeout in milliseconds to wait for a DNS query to resolve\n\t\t},\n\t},\n\tlogLevel: LoggingLevel.INFO, // Sets the level of logging\n\tredirectCount: 20, // Set custom redirect limit\n}\n```\n","readmeFilename":"README.md","gitHead":"b08c3939239a3aa80fd7ca49d3ef607a6969ac3b","_nodeVersion":"20.10.0","_npmVersion":"10.2.3","dist":{"integrity":"sha512-vwlywZv+6XHTf3xoTSstCnHQ2dPasObUNaFp5mcVbXsBN8PnbmEr1pgAIqu4J1nL0GGSWgFBRa0t7SZXhiX6+w==","shasum":"05cf6c582da24751fedba5c3f36cdd845ef35408","tarball":"https://registry.npmjs.org/@autosec/fetchhole/-/fetchhole-0.1.1-nightly.7.tgz","fileCount":20,"unpackedSize":46591,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@autosec%2ffetchhole@0.1.1-nightly.7","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCLICv6vYMq0sPVamBaFEtxim358ZU/sH1bI9BatyA2YQIhAPz/3QnzwVgifCQNPyqil0dbK3YQP2HdkI8IbfgZOfFv"}]},"_npmUser":{"name":"demosjarco","email":"demosjarco@protonmail.com"},"directories":{},"maintainers":[{"name":"demosjarco","email":"demosjarco@protonmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetchhole_0.1.1-nightly.7_1703096047302_0.1684112960815538"},"_hasShrinkwrap":false},"0.1.1-nightly.8":{"name":"@autosec/fetchhole","version":"0.1.1-nightly.8","description":"Boost your FaaS development with fetchhole, a secure, drop-in replacement for the native `fetch()` function, designed for security-focused web developers.","type":"module","main":"./dist/index.mjs","types":"./dist/index.d.mts","scripts":{"build":"tsc","build:watch":"npm run build -- --watch","test":"node --loader ts-node/esm --test --test-reporter=spec"},"repository":{"type":"git","url":"git+https://github.com/autosec-network/FetchHole.git"},"author":{"name":"Autosec"},"contributors":[{"name":"DemosJarco","email":"1209494+demosjarco@users.noreply.github.com"},{"name":"Sam Gammon","email":"sam@elide.dev"}],"license":"MIT","bugs":{"url":"https://github.com/autosec-network/FetchHole/issues"},"homepage":"https://github.com/autosec-network/FetchHole#readme","engines":{"node":">=16.15.0"},"publishConfig":{"access":"public"},"exports":{".":"./dist/index.mjs"},"imports":{".":{"default":"./dist/index.mjs","types":"./dist/index.d.mts"}},"prettier":"@demosjarco/prettier-config","dependencies":{"chalk":"^5.3.0","dns-packet":"^5.6.1"},"devDependencies":{"@demosjarco/prettier-config":"^1.0.1","@swc/core":"^1.3.99","@types/dns-packet":"^5.6.4","@types/node":"^20.9.2","prettier":"^3.1.0","ts-node":"^10.9.1","typescript":"^5.3.2"},"_id":"@autosec/fetchhole@0.1.1-nightly.8","readme":"[![License](https://img.shields.io/github/license/autosec-network/FetchHole)](LICENSE)\n[![TypeScript](https://badgen.net/npm/types/@autosec-network/FetchHole)](https://www.npmjs.com/package/@autosec/fetchhole)\n[![npm](https://img.shields.io/npm/v/@autosec-network/FetchHole)](https://www.npmjs.com/package/@autosec/fetchhole)\n[![npm](https://img.shields.io/npm/dm/@autosec-network/FetchHole)](https://www.npmjs.com/package/@autosec/fetchhole)\n[![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/autosec-network/FetchHole/badge)](https://securityscorecards.dev/viewer/?uri=github.com/autosec-network/FetchHole)\n[![Socket Badge](https://socket.dev/api/badge/npm/package/@autosec-network/FetchHole)](https://socket.dev/npm/package/@autosec-network/FetchHole)\n\n# FetchHole\n\nElevate your Function as a Service (FaaS) development with enhanced security at the edge using `@autosec/fetchhole`. This package acts as a sophisticated drop-in replacement for the native `fetch()` function, tailored for developers who emphasize security in their web applications.\n\n## Features\n\n-   **Drop-in Replacement**: Seamlessly integrates with existing code, replacing the native `fetch()` function.\n-   **Advanced Logging**: Comprehensive logging capabilities for effective debugging.\n-   **Redirect Intercept**: Customize redirect limits with a default of 20, as per the WHATWG Fetch specification.\n-   **Header Computation**: Automatically computes and adds missing `Content-Length` and `ETag` headers. Choose your preferred ETag hash algorithm, with `sha256` as the default.\n-   **Cache Support**: Utilizes memory or disk caching via the Cache Web API. Compatible with Cloudflare's cache API for Cloudflare users.\n-   **Intercept for Alternate Routing**: Ideal for scenarios like Cloudflare Workers Binding, allowing for alternate request routing.\n-   **Custom DNS Resolver Support**: Designed for DNS level security applications like Zero Trust services. Compatible with any DoH resolver that uses `0.0.0.0` for blocking.\n    -   **Direct IP Address Handling**: Offers three modes for handling direct IP address access:\n        -   Full Block\n        -   Fail if No PTR Record (conducts a PTR record check, followed by a standard DNS check)\n        -   Allow\n\n## Supported Environments\n\n-   [x] NodeJS v16.15.0 or later (that's when NodeJS got native `fetch()` support) environments\n-   [ ] Browser support\n-   [x] Cloudflare Workers/Pages with `compatibility_flags = [ \"nodejs_compat\" ]` (not to be confused with `node_compat = true`)\n    > [!NOTE]\n    > When Browser support lands, it's still recommended to use `nodejs_compat` because those apis run faster and are more robust\n\n## Installation\n\n```bash\nnpm install @autosec/fetchhole\n```\n\n## Usage\n\nSimply import fetchhole and use it as a replacement for the native fetch() function.\n\n```ts\n// TODO\n```\n\n## Configuration\n\nYou can customize fetchhole with various options to suit your needs. Settings can be applied at the class instance level or as an fetch init property:\n\n```ts\n{\n\tcache: {\n\t\ttype: CacheType.Default, // Defines cache type\n\t\thashAlgorithm: 'sha256', // Choose a different ETag hash algorithm\n\t\tignoreMethod: false,\n\t\tignoreSearch: false,\n\t\tignoreVary: false,\n\t},\n\tdohServer: {\n\t\tprovider: 'https://dns.quad9.net/dns-query', // The server used to run security check\n\t\textraHeaders: new Headers(), // Other headers needed by DoH server other than required by RFC 8484\n\t\ttimeout: 2 * 1000, // Timeout in milliseconds to wait for a DNS query to resolve\n\t},\n\thardFail: true, // Determines failure handling\n\tip: {\n\t\tpolicy: IPBlockMode.BlockIfNxPTR,\n\t\tptrDohServer: {\n\t\t\tprovider: 'https://dns.google/dns-query', // The server used to perform PTR lookups, not security checks\n\t\t\textraHeaders: new Headers(), // Other headers needed by DoH server other than required by RFC 8484\n\t\t\ttimeout: 2 * 1000, // Timeout in milliseconds to wait for a DNS query to resolve\n\t\t},\n\t},\n\tlogLevel: LoggingLevel.INFO, // Sets the level of logging\n\tredirectCount: 20, // Set custom redirect limit\n}\n```\n","readmeFilename":"README.md","gitHead":"03174d075308b3e66e495a89f899735caec34d9b","_nodeVersion":"20.10.0","_npmVersion":"10.2.3","dist":{"integrity":"sha512-ima95u2iwA1XpqEoi+r2Q8UBe2k68h6RMzBT3HK7Wy55XlEdnSCFA2soSqwUnFUhDHpGeztCv1fLRlwLvxUgJQ==","shasum":"dceeb6c81cb133ea2ce45c2403f45333ae8c2292","tarball":"https://registry.npmjs.org/@autosec/fetchhole/-/fetchhole-0.1.1-nightly.8.tgz","fileCount":20,"unpackedSize":46591,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@autosec%2ffetchhole@0.1.1-nightly.8","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGfdSkh/qNwaRixFLLQDfTDaA8eH3Z5St/VQ90tbtM7SAiEA4+H6xgDgDE7wWqOuMb7gT3OcwgwK1uzcWHeH582YFqc="}]},"_npmUser":{"name":"demosjarco","email":"demosjarco@protonmail.com"},"directories":{},"maintainers":[{"name":"demosjarco","email":"demosjarco@protonmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetchhole_0.1.1-nightly.8_1703096248416_0.3737994498291708"},"_hasShrinkwrap":false},"0.1.1-nightly.9":{"name":"@autosec/fetchhole","version":"0.1.1-nightly.9","description":"Boost your FaaS development with fetchhole, a secure, drop-in replacement for the native `fetch()` function, designed for security-focused web developers.","type":"module","main":"./dist/index.mjs","types":"./dist/index.d.mts","scripts":{"build":"tsc","build:watch":"npm run build -- --watch","test":"node --loader ts-node/esm --test --test-reporter=spec"},"repository":{"type":"git","url":"git+https://github.com/autosec-network/FetchHole.git"},"author":{"name":"Autosec"},"contributors":[{"name":"DemosJarco","email":"1209494+demosjarco@users.noreply.github.com"},{"name":"Sam Gammon","email":"sam@elide.dev"}],"license":"MIT","bugs":{"url":"https://github.com/autosec-network/FetchHole/issues"},"homepage":"https://github.com/autosec-network/FetchHole#readme","engines":{"node":">=16.15.0"},"publishConfig":{"access":"public"},"exports":{".":"./dist/index.mjs"},"imports":{".":{"default":"./dist/index.mjs","types":"./dist/index.d.mts"}},"prettier":"@demosjarco/prettier-config","dependencies":{"chalk":"^5.3.0","dns-packet":"^5.6.1"},"devDependencies":{"@demosjarco/prettier-config":"^1.0.1","@swc/core":"^1.3.99","@types/dns-packet":"^5.6.4","@types/node":"^20.9.2","prettier":"^3.1.0","ts-node":"^10.9.1","typescript":"^5.3.2"},"_id":"@autosec/fetchhole@0.1.1-nightly.9","readme":"[![License](https://img.shields.io/github/license/autosec-network/FetchHole)](LICENSE)\n[![TypeScript](https://badgen.net/npm/types/@autosec-network/FetchHole)](https://www.npmjs.com/package/@autosec/fetchhole)\n[![npm](https://img.shields.io/npm/v/@autosec-network/FetchHole)](https://www.npmjs.com/package/@autosec/fetchhole)\n[![npm](https://img.shields.io/npm/dm/@autosec-network/FetchHole)](https://www.npmjs.com/package/@autosec/fetchhole)\n[![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/autosec-network/FetchHole/badge)](https://securityscorecards.dev/viewer/?uri=github.com/autosec-network/FetchHole)\n[![Socket Badge](https://socket.dev/api/badge/npm/package/@autosec-network/FetchHole)](https://socket.dev/npm/package/@autosec-network/FetchHole)\n\n# FetchHole\n\nElevate your Function as a Service (FaaS) development with enhanced security at the edge using `@autosec/fetchhole`. This package acts as a sophisticated drop-in replacement for the native `fetch()` function, tailored for developers who emphasize security in their web applications.\n\n## Features\n\n-   **Drop-in Replacement**: Seamlessly integrates with existing code, replacing the native `fetch()` function.\n-   **Advanced Logging**: Comprehensive logging capabilities for effective debugging.\n-   **Redirect Intercept**: Customize redirect limits with a default of 20, as per the WHATWG Fetch specification.\n-   **Header Computation**: Automatically computes and adds missing `Content-Length` and `ETag` headers. Choose your preferred ETag hash algorithm, with `sha256` as the default.\n-   **Cache Support**: Utilizes memory or disk caching via the Cache Web API. Compatible with Cloudflare's cache API for Cloudflare users.\n-   **Intercept for Alternate Routing**: Ideal for scenarios like Cloudflare Workers Binding, allowing for alternate request routing.\n-   **Custom DNS Resolver Support**: Designed for DNS level security applications like Zero Trust services. Compatible with any DoH resolver that uses `0.0.0.0` for blocking.\n    -   **Direct IP Address Handling**: Offers three modes for handling direct IP address access:\n        -   Full Block\n        -   Fail if No PTR Record (conducts a PTR record check, followed by a standard DNS check)\n        -   Allow\n\n## Supported Environments\n\n-   [x] NodeJS v16.15.0 or later (that's when NodeJS got native `fetch()` support) environments\n-   [ ] Browser support\n-   [x] Cloudflare Workers/Pages with `compatibility_flags = [ \"nodejs_compat\" ]` (not to be confused with `node_compat = true`)\n    > [!NOTE]\n    > When Browser support lands, it's still recommended to use `nodejs_compat` because those apis run faster and are more robust\n\n## Installation\n\n```bash\nnpm install @autosec/fetchhole\n```\n\n## Usage\n\nSimply import fetchhole and use it as a replacement for the native fetch() function.\n\n```ts\n// TODO\n```\n\n## Configuration\n\nYou can customize fetchhole with various options to suit your needs. Settings can be applied at the class instance level or as an fetch init property:\n\n```ts\n{\n\tcache: {\n\t\ttype: CacheType.Default, // Defines cache type\n\t\thashAlgorithm: 'sha256', // Choose a different ETag hash algorithm\n\t\tignoreMethod: false,\n\t\tignoreSearch: false,\n\t\tignoreVary: false,\n\t},\n\tdohServer: {\n\t\tprovider: 'https://dns.quad9.net/dns-query', // The server used to run security check\n\t\textraHeaders: new Headers(), // Other headers needed by DoH server other than required by RFC 8484\n\t\ttimeout: 2 * 1000, // Timeout in milliseconds to wait for a DNS query to resolve\n\t},\n\thardFail: true, // Determines failure handling\n\tip: {\n\t\tpolicy: IPBlockMode.BlockIfNxPTR,\n\t\tptrDohServer: {\n\t\t\tprovider: 'https://dns.google/dns-query', // The server used to perform PTR lookups, not security checks\n\t\t\textraHeaders: new Headers(), // Other headers needed by DoH server other than required by RFC 8484\n\t\t\ttimeout: 2 * 1000, // Timeout in milliseconds to wait for a DNS query to resolve\n\t\t},\n\t},\n\tlogLevel: LoggingLevel.INFO, // Sets the level of logging\n\tredirectCount: 20, // Set custom redirect limit\n}\n```\n","readmeFilename":"README.md","gitHead":"bb102c4a021635ef14ffc0fded592c5e047288fd","_nodeVersion":"20.10.0","_npmVersion":"10.2.3","dist":{"integrity":"sha512-6Z4oA4eUsFDwSgG+A8LFDA9bx2+6OpWXExaRVwO+GmNAZCA+3Q+poh0OZkuJrf75iRkaqq1+YT88gLLbybrBcQ==","shasum":"2cbcde64288243052a49067ca078597ac18449d9","tarball":"https://registry.npmjs.org/@autosec/fetchhole/-/fetchhole-0.1.1-nightly.9.tgz","fileCount":20,"unpackedSize":46591,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@autosec%2ffetchhole@0.1.1-nightly.9","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDsAL2ZCqFXdkw6B/7+ePTC7C5OlOKssK/ARWREjhTi3AIgfYwwWMGKvENwoP9pKNTXyFIq3k7mt4S67cwCZzvO/PQ="}]},"_npmUser":{"name":"demosjarco","email":"demosjarco@protonmail.com"},"directories":{},"maintainers":[{"name":"demosjarco","email":"demosjarco@protonmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetchhole_0.1.1-nightly.9_1703101057709_0.5074286142182196"},"_hasShrinkwrap":false},"0.1.1-nightly.10":{"name":"@autosec/fetchhole","version":"0.1.1-nightly.10","description":"Boost your FaaS development with fetchhole, a secure, drop-in replacement for the native `fetch()` function, designed for security-focused web developers.","type":"module","main":"./dist/index.mjs","types":"./dist/index.d.mts","scripts":{"build":"tsc","build:watch":"npm run build -- --watch","test":"node --loader ts-node/esm --test --test-reporter=spec"},"repository":{"type":"git","url":"git+https://github.com/autosec-network/FetchHole.git"},"author":{"name":"Autosec"},"contributors":[{"name":"DemosJarco","email":"1209494+demosjarco@users.noreply.github.com"},{"name":"Sam Gammon","email":"sam@elide.dev"}],"license":"MIT","bugs":{"url":"https://github.com/autosec-network/FetchHole/issues"},"homepage":"https://github.com/autosec-network/FetchHole#readme","engines":{"node":">=16.15.0"},"publishConfig":{"access":"public"},"exports":{".":"./dist/index.mjs"},"imports":{".":{"default":"./dist/index.mjs","types":"./dist/index.d.mts"}},"prettier":"@demosjarco/prettier-config","dependencies":{"chalk":"^5.3.0","dns-packet":"^5.6.1"},"devDependencies":{"@demosjarco/prettier-config":"^1.0.1","@swc/core":"^1.3.99","@types/dns-packet":"^5.6.4","@types/node":"^20.9.2","prettier":"^3.1.0","ts-node":"^10.9.1","typescript":"^5.3.2"},"_id":"@autosec/fetchhole@0.1.1-nightly.10","readme":"[![License](https://img.shields.io/github/license/autosec-network/FetchHole)](LICENSE)\n[![TypeScript](https://badgen.net/npm/types/@autosec-network/FetchHole)](https://www.npmjs.com/package/@autosec/fetchhole)\n[![npm](https://img.shields.io/npm/v/@autosec-network/FetchHole)](https://www.npmjs.com/package/@autosec/fetchhole)\n[![npm](https://img.shields.io/npm/dm/@autosec-network/FetchHole)](https://www.npmjs.com/package/@autosec/fetchhole)\n[![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/autosec-network/FetchHole/badge)](https://securityscorecards.dev/viewer/?uri=github.com/autosec-network/FetchHole)\n[![Socket Badge](https://socket.dev/api/badge/npm/package/@autosec-network/FetchHole)](https://socket.dev/npm/package/@autosec-network/FetchHole)\n\n# FetchHole\n\nElevate your Function as a Service (FaaS) development with enhanced security at the edge using `@autosec/fetchhole`. This package acts as a sophisticated drop-in replacement for the native `fetch()` function, tailored for developers who emphasize security in their web applications.\n\n## Features\n\n-   **Drop-in Replacement**: Seamlessly integrates with existing code, replacing the native `fetch()` function.\n-   **Advanced Logging**: Comprehensive logging capabilities for effective debugging.\n-   **Redirect Intercept**: Customize redirect limits with a default of 20, as per the WHATWG Fetch specification.\n-   **Header Computation**: Automatically computes and adds missing `Content-Length` and `ETag` headers. Choose your preferred ETag hash algorithm, with `sha256` as the default.\n-   **Cache Support**: Utilizes memory or disk caching via the Cache Web API. Compatible with Cloudflare's cache API for Cloudflare users.\n-   **Intercept for Alternate Routing**: Ideal for scenarios like Cloudflare Workers Binding, allowing for alternate request routing.\n-   **Custom DNS Resolver Support**: Designed for DNS level security applications like Zero Trust services. Compatible with any DoH resolver that uses `0.0.0.0` for blocking.\n    -   **Direct IP Address Handling**: Offers three modes for handling direct IP address access:\n        -   Full Block\n        -   Fail if No PTR Record (conducts a PTR record check, followed by a standard DNS check)\n        -   Allow\n\n## Supported Environments\n\n-   [x] NodeJS v16.15.0 or later (that's when NodeJS got native `fetch()` support) environments\n-   [ ] Browser support\n-   [x] Cloudflare Workers/Pages with `compatibility_flags = [ \"nodejs_compat\" ]` (not to be confused with `node_compat = true`)\n    > [!NOTE]\n    > When Browser support lands, it's still recommended to use `nodejs_compat` because those apis run faster and are more robust\n\n## Installation\n\n```bash\nnpm install @autosec/fetchhole\n```\n\n## Usage\n\nSimply import fetchhole and use it as a replacement for the native fetch() function.\n\n```ts\n// TODO\n```\n\n## Configuration\n\nYou can customize fetchhole with various options to suit your needs. Settings can be applied at the class instance level or as an fetch init property:\n\n```ts\n{\n\tcache: {\n\t\ttype: CacheType.Default, // Defines cache type\n\t\thashAlgorithm: 'sha256', // Choose a different ETag hash algorithm\n\t\tignoreMethod: false,\n\t\tignoreSearch: false,\n\t\tignoreVary: false,\n\t},\n\tdohServer: {\n\t\tprovider: 'https://dns.quad9.net/dns-query', // The server used to run security check\n\t\textraHeaders: new Headers(), // Other headers needed by DoH server other than required by RFC 8484\n\t\ttimeout: 2 * 1000, // Timeout in milliseconds to wait for a DNS query to resolve\n\t},\n\thardFail: true, // Determines failure handling\n\tip: {\n\t\tpolicy: IPBlockMode.BlockIfNxPTR,\n\t\tptrDohServer: {\n\t\t\tprovider: 'https://dns.google/dns-query', // The server used to perform PTR lookups, not security checks\n\t\t\textraHeaders: new Headers(), // Other headers needed by DoH server other than required by RFC 8484\n\t\t\ttimeout: 2 * 1000, // Timeout in milliseconds to wait for a DNS query to resolve\n\t\t},\n\t},\n\tlogLevel: LoggingLevel.INFO, // Sets the level of logging\n\tredirectCount: 20, // Set custom redirect limit\n}\n```\n","readmeFilename":"README.md","gitHead":"e69e799eb2a5d1cb76cc7b6a5844b7318ad19509","_nodeVersion":"20.10.0","_npmVersion":"10.2.3","dist":{"integrity":"sha512-x55QXoVGxUige/tm5NG6+rVv/5fipDqQlV9GZjDg0khP1KNcFXDemXkiX4ONS3W+QpBIp2sjpze2lc3Q/bQdQQ==","shasum":"66b28acf2b15e523020e8b2f09c93b598d2cc6f5","tarball":"https://registry.npmjs.org/@autosec/fetchhole/-/fetchhole-0.1.1-nightly.10.tgz","fileCount":24,"unpackedSize":49134,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@autosec%2ffetchhole@0.1.1-nightly.10","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBYEe8zVxEKzb7oRvKKZrIEz0UXsnvo9Yv37bkn51gvaAiB8vQV3r3Bm6RFP19aHhTpYR/HOiPhgXavuFAuawmInnQ=="}]},"_npmUser":{"name":"demosjarco","email":"demosjarco@protonmail.com"},"directories":{},"maintainers":[{"name":"demosjarco","email":"demosjarco@protonmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetchhole_0.1.1-nightly.10_1703103924293_0.5115294172874669"},"_hasShrinkwrap":false},"0.1.1-nightly.11":{"name":"@autosec/fetchhole","version":"0.1.1-nightly.11","description":"Boost your FaaS development with fetchhole, a secure, drop-in replacement for the native `fetch()` function, designed for security-focused web developers.","type":"module","main":"./dist/index.mjs","types":"./dist/index.d.mts","scripts":{"build":"tsc","build:watch":"npm run build -- --watch","test":"node --loader ts-node/esm --test --test-reporter=spec"},"repository":{"type":"git","url":"git+https://github.com/autosec-network/FetchHole.git"},"author":{"name":"Autosec"},"contributors":[{"name":"DemosJarco","email":"1209494+demosjarco@users.noreply.github.com"},{"name":"Sam Gammon","email":"sam@elide.dev"}],"license":"MIT","bugs":{"url":"https://github.com/autosec-network/FetchHole/issues"},"homepage":"https://github.com/autosec-network/FetchHole#readme","engines":{"node":">=16.15.0"},"publishConfig":{"access":"public"},"exports":{".":"./dist/index.mjs"},"imports":{".":{"default":"./dist/index.mjs","types":"./dist/index.d.mts"}},"prettier":"@demosjarco/prettier-config","dependencies":{"chalk":"^5.3.0","dns-packet":"^5.6.1"},"devDependencies":{"@demosjarco/prettier-config":"^1.0.1","@swc/core":"^1.3.99","@types/dns-packet":"^5.6.4","@types/node":"^20.9.2","prettier":"^3.1.0","ts-node":"^10.9.1","typescript":"^5.3.2"},"_id":"@autosec/fetchhole@0.1.1-nightly.11","readme":"[![License](https://img.shields.io/github/license/autosec-network/FetchHole)](LICENSE)\n[![TypeScript](https://badgen.net/npm/types/@autosec-network/FetchHole)](https://www.npmjs.com/package/@autosec/fetchhole)\n[![npm](https://img.shields.io/npm/v/@autosec-network/FetchHole)](https://www.npmjs.com/package/@autosec/fetchhole)\n[![npm](https://img.shields.io/npm/dm/@autosec-network/FetchHole)](https://www.npmjs.com/package/@autosec/fetchhole)\n[![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/autosec-network/FetchHole/badge)](https://securityscorecards.dev/viewer/?uri=github.com/autosec-network/FetchHole)\n[![Socket Badge](https://socket.dev/api/badge/npm/package/@autosec-network/FetchHole)](https://socket.dev/npm/package/@autosec-network/FetchHole)\n\n# FetchHole\n\nElevate your Function as a Service (FaaS) development with enhanced security at the edge using `@autosec/fetchhole`. This package acts as a sophisticated drop-in replacement for the native `fetch()` function, tailored for developers who emphasize security in their web applications.\n\n## Features\n\n-   **Drop-in Replacement**: Seamlessly integrates with existing code, replacing the native `fetch()` function.\n-   **Advanced Logging**: Comprehensive logging capabilities for effective debugging.\n-   **Redirect Intercept**: Customize redirect limits with a default of 20, as per the WHATWG Fetch specification.\n-   **Header Computation**: Automatically computes and adds missing `Content-Length` and `ETag` headers. Choose your preferred ETag hash algorithm, with `sha256` as the default.\n-   **Cache Support**: Utilizes memory or disk caching via the Cache Web API. Compatible with Cloudflare's cache API for Cloudflare users.\n-   **Intercept for Alternate Routing**: Ideal for scenarios like Cloudflare Workers Binding, allowing for alternate request routing.\n-   **Custom DNS Resolver Support**: Designed for DNS level security applications like Zero Trust services. Compatible with any DoH resolver that uses `0.0.0.0` for blocking.\n    -   **Direct IP Address Handling**: Offers three modes for handling direct IP address access:\n        -   Full Block\n        -   Fail if No PTR Record (conducts a PTR record check, followed by a standard DNS check)\n        -   Allow\n\n## Supported Environments\n\n-   [x] NodeJS v16.15.0 or later (that's when NodeJS got native `fetch()` support) environments\n-   [ ] Browser support\n-   [x] Cloudflare Workers/Pages with `compatibility_flags = [ \"nodejs_compat\" ]` (not to be confused with `node_compat = true`)\n    > [!NOTE]\n    > When Browser support lands, it's still recommended to use `nodejs_compat` because those apis run faster and are more robust\n\n## Installation\n\n```bash\nnpm install @autosec/fetchhole\n```\n\n## Usage\n\nSimply import fetchhole and use it as a replacement for the native fetch() function.\n\n```ts\n// TODO\n```\n\n## Configuration\n\nYou can customize fetchhole with various options to suit your needs. Settings can be applied at the class instance level or as an fetch init property:\n\n```ts\n{\n\tcache: {\n\t\ttype: CacheType.Default, // Defines cache type\n\t\thashAlgorithm: 'sha256', // Choose a different ETag hash algorithm\n\t\tignoreMethod: false,\n\t\tignoreSearch: false,\n\t\tignoreVary: false,\n\t},\n\tdohServer: {\n\t\tprovider: 'https://dns.quad9.net/dns-query', // The server used to run security check\n\t\textraHeaders: new Headers(), // Other headers needed by DoH server other than required by RFC 8484\n\t\ttimeout: 2 * 1000, // Timeout in milliseconds to wait for a DNS query to resolve\n\t},\n\thardFail: true, // Determines failure handling\n\tip: {\n\t\tpolicy: IPBlockMode.BlockIfNxPTR,\n\t\tptrDohServer: {\n\t\t\tprovider: 'https://dns.google/dns-query', // The server used to perform PTR lookups, not security checks\n\t\t\textraHeaders: new Headers(), // Other headers needed by DoH server other than required by RFC 8484\n\t\t\ttimeout: 2 * 1000, // Timeout in milliseconds to wait for a DNS query to resolve\n\t\t},\n\t},\n\tlogLevel: LoggingLevel.INFO, // Sets the level of logging\n\tredirectCount: 20, // Set custom redirect limit\n}\n```\n","readmeFilename":"README.md","gitHead":"95c1beb5cb0897a2e0f534c39282d2c5c9998bdf","_nodeVersion":"20.10.0","_npmVersion":"10.2.3","dist":{"integrity":"sha512-Dr0rm3tf4kG0UO1MaDue2RpUAJrZ5v+0zVAVcEA5g0spPRppzLI4HeVCNFaX6elvN52d2BcVgClpKIm5m/6N4w==","shasum":"7da77fbd5ba1c0e9909431233a02975b97279d8e","tarball":"https://registry.npmjs.org/@autosec/fetchhole/-/fetchhole-0.1.1-nightly.11.tgz","fileCount":24,"unpackedSize":49295,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@autosec%2ffetchhole@0.1.1-nightly.11","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD/GAC+GbV1DIpgqEpg+68SjLKSKiqkCwglpETnf6SZ4QIhAMjW/C87i/L+AB3j6iLDMrqKkRsxFmEgamL8pTTqyYEe"}]},"_npmUser":{"name":"demosjarco","email":"demosjarco@protonmail.com"},"directories":{},"maintainers":[{"name":"demosjarco","email":"demosjarco@protonmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetchhole_0.1.1-nightly.11_1703125924343_0.5644094951277729"},"_hasShrinkwrap":false},"0.1.1-nightly.12":{"name":"@autosec/fetchhole","version":"0.1.1-nightly.12","description":"Boost your FaaS development with fetchhole, a secure, drop-in replacement for the native `fetch()` function, designed for security-focused web developers.","type":"module","main":"./dist/index.mjs","types":"./dist/index.d.mts","scripts":{"build":"tsc","build:watch":"npm run build -- --watch","test":"node --loader ts-node/esm --test --test-reporter=spec"},"repository":{"type":"git","url":"git+https://github.com/autosec-network/FetchHole.git"},"author":{"name":"Autosec"},"contributors":[{"name":"DemosJarco","email":"1209494+demosjarco@users.noreply.github.com"},{"name":"Sam Gammon","email":"sam@elide.dev"}],"license":"MIT","bugs":{"url":"https://github.com/autosec-network/FetchHole/issues"},"homepage":"https://github.com/autosec-network/FetchHole#readme","engines":{"node":">=16.15.0"},"publishConfig":{"access":"public"},"exports":{".":"./dist/index.mjs"},"imports":{".":{"default":"./dist/index.mjs","types":"./dist/index.d.mts"}},"prettier":"@demosjarco/prettier-config","dependencies":{"chalk":"^5.3.0","dns-packet":"^5.6.1"},"devDependencies":{"@demosjarco/prettier-config":"^1.0.1","@swc/core":"^1.3.99","@types/dns-packet":"^5.6.4","@types/node":"^20.9.2","prettier":"^3.1.0","ts-node":"^10.9.1","typescript":"^5.3.2"},"_id":"@autosec/fetchhole@0.1.1-nightly.12","readme":"[![License](https://img.shields.io/github/license/autosec-network/FetchHole)](LICENSE)\n[![TypeScript](https://badgen.net/npm/types/@autosec-network/FetchHole)](https://www.npmjs.com/package/@autosec/fetchhole)\n[![npm](https://img.shields.io/npm/v/@autosec-network/FetchHole)](https://www.npmjs.com/package/@autosec/fetchhole)\n[![npm](https://img.shields.io/npm/dm/@autosec-network/FetchHole)](https://www.npmjs.com/package/@autosec/fetchhole)\n[![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/autosec-network/FetchHole/badge)](https://securityscorecards.dev/viewer/?uri=github.com/autosec-network/FetchHole)\n[![Socket Badge](https://socket.dev/api/badge/npm/package/@autosec-network/FetchHole)](https://socket.dev/npm/package/@autosec-network/FetchHole)\n\n# FetchHole\n\nElevate your Function as a Service (FaaS) development with enhanced security at the edge using `@autosec/fetchhole`. This package acts as a sophisticated drop-in replacement for the native `fetch()` function, tailored for developers who emphasize security in their web applications.\n\n## Features\n\n-   **Drop-in Replacement**: Seamlessly integrates with existing code, replacing the native `fetch()` function.\n-   **Advanced Logging**: Comprehensive logging capabilities for effective debugging.\n-   **Redirect Intercept**: Customize redirect limits with a default of 20, as per the WHATWG Fetch specification.\n-   **Header Computation**: Automatically computes and adds missing `Content-Length` and `ETag` headers. Choose your preferred ETag hash algorithm, with `sha256` as the default.\n-   **Cache Support**: Utilizes memory or disk caching via the Cache Web API. Compatible with Cloudflare's cache API for Cloudflare users.\n-   **Intercept for Alternate Routing**: Ideal for scenarios like Cloudflare Workers Binding, allowing for alternate request routing.\n-   **Custom DNS Resolver Support**: Designed for DNS level security applications like Zero Trust services. Compatible with any DoH resolver that uses `0.0.0.0` for blocking.\n    -   **Direct IP Address Handling**: Offers three modes for handling direct IP address access:\n        -   Full Block\n        -   Fail if No PTR Record (conducts a PTR record check, followed by a standard DNS check)\n        -   Allow\n\n## Supported Environments\n\n-   [x] NodeJS v16.15.0 or later (that's when NodeJS got native `fetch()` support) environments\n-   [ ] Browser support\n-   [x] Cloudflare Workers/Pages with `compatibility_flags = [ \"nodejs_compat\" ]` (not to be confused with `node_compat = true`)\n    > [!NOTE]\n    > When Browser support lands, it's still recommended to use `nodejs_compat` because those apis run faster and are more robust\n\n## Installation\n\n```bash\nnpm install @autosec/fetchhole\n```\n\n## Usage\n\nSimply import fetchhole and use it as a replacement for the native fetch() function.\n\n```ts\n// TODO\n```\n\n## Configuration\n\nYou can customize fetchhole with various options to suit your needs. Settings can be applied at the class instance level or as an fetch init property:\n\n```ts\n{\n\tcache: {\n\t\ttype: CacheType.Default, // Defines cache type\n\t\thashAlgorithm: 'sha256', // Choose a different ETag hash algorithm\n\t\tignoreMethod: false,\n\t\tignoreSearch: false,\n\t\tignoreVary: false,\n\t},\n\tdohServer: {\n\t\tprovider: 'https://dns.quad9.net/dns-query', // The server used to run security check\n\t\textraHeaders: new Headers(), // Other headers needed by DoH server other than required by RFC 8484\n\t\ttimeout: 2 * 1000, // Timeout in milliseconds to wait for a DNS query to resolve\n\t},\n\thardFail: true, // Determines failure handling\n\tip: {\n\t\tpolicy: IPBlockMode.BlockIfNxPTR,\n\t\tptrDohServer: {\n\t\t\tprovider: 'https://dns.google/dns-query', // The server used to perform PTR lookups, not security checks\n\t\t\textraHeaders: new Headers(), // Other headers needed by DoH server other than required by RFC 8484\n\t\t\ttimeout: 2 * 1000, // Timeout in milliseconds to wait for a DNS query to resolve\n\t\t},\n\t},\n\tlogLevel: LoggingLevel.INFO, // Sets the level of logging\n\tredirectCount: 20, // Set custom redirect limit\n}\n```\n","readmeFilename":"README.md","gitHead":"998082796eb749e9bc396c666328b149afd8127f","_nodeVersion":"20.10.0","_npmVersion":"10.2.3","dist":{"integrity":"sha512-NdGTqNGfDgYXRRSkym01sJVyBBdag4LWoP3Du8I7j8/qowfZoQ2HpYD4eMydcHPkDzDcXi85xP2FFbET3cMZrQ==","shasum":"66df90811c2f0f4eb54566bd1e669f5d9139ad72","tarball":"https://registry.npmjs.org/@autosec/fetchhole/-/fetchhole-0.1.1-nightly.12.tgz","fileCount":28,"unpackedSize":56817,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@autosec%2ffetchhole@0.1.1-nightly.12","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDcfQZC9vDN2TRSjI3N6WkFRIpFDXjwXPKx/vqJMLzXhAiAsF2My6QP5LoSkX2EZZ+qHpuFj0xUOFEY2RaY36i91BA=="}]},"_npmUser":{"name":"demosjarco","email":"demosjarco@protonmail.com"},"directories":{},"maintainers":[{"name":"demosjarco","email":"demosjarco@protonmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetchhole_0.1.1-nightly.12_1703126772967_0.6408478000282549"},"_hasShrinkwrap":false},"0.1.1-nightly.13":{"name":"@autosec/fetchhole","version":"0.1.1-nightly.13","description":"Boost your FaaS development with fetchhole, a secure, drop-in replacement for the native `fetch()` function, designed for security-focused web developers.","type":"module","main":"./dist/index.mjs","types":"./dist/index.d.mts","scripts":{"build":"tsc","build:watch":"npm run build -- --watch","test":"node --loader ts-node/esm --test --test-reporter=spec"},"repository":{"type":"git","url":"git+https://github.com/autosec-network/FetchHole.git"},"author":{"name":"Autosec"},"contributors":[{"name":"DemosJarco","email":"1209494+demosjarco@users.noreply.github.com"},{"name":"Sam Gammon","email":"sam@elide.dev"}],"license":"MIT","bugs":{"url":"https://github.com/autosec-network/FetchHole/issues"},"homepage":"https://github.com/autosec-network/FetchHole#readme","engines":{"node":">=16.15.0"},"publishConfig":{"access":"public"},"exports":{".":"./dist/index.mjs","./cache":"./dist/cache/index.mjs","./doh":"./dist/doh/index.mjs"},"imports":{".":{"default":"./dist/index.mjs","types":"./dist/index.d.mts"},"./cache":{"default":"./dist/cache/index.mjs","types":"./dist/cache/index.d.mts"},"./doh":{"default":"./dist/doh/index.mjs","types":"./dist/doh/index.d.mts"}},"prettier":"@demosjarco/prettier-config","dependencies":{"chalk":"^5.3.0","dns-packet":"^5.6.1"},"devDependencies":{"@demosjarco/prettier-config":"^1.0.1","@swc/core":"^1.3.99","@types/dns-packet":"^5.6.4","@types/node":"^20.9.2","prettier":"^3.1.0","ts-node":"^10.9.1","typescript":"^5.3.2"},"_id":"@autosec/fetchhole@0.1.1-nightly.13","readme":"[![License](https://img.shields.io/github/license/autosec-network/FetchHole)](LICENSE)\n[![TypeScript](https://badgen.net/npm/types/@autosec-network/FetchHole)](https://www.npmjs.com/package/@autosec/fetchhole)\n[![npm](https://img.shields.io/npm/v/@autosec-network/FetchHole)](https://www.npmjs.com/package/@autosec/fetchhole)\n[![npm](https://img.shields.io/npm/dm/@autosec-network/FetchHole)](https://www.npmjs.com/package/@autosec/fetchhole)\n[![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/autosec-network/FetchHole/badge)](https://securityscorecards.dev/viewer/?uri=github.com/autosec-network/FetchHole)\n[![Socket Badge](https://socket.dev/api/badge/npm/package/@autosec-network/FetchHole)](https://socket.dev/npm/package/@autosec-network/FetchHole)\n\n# FetchHole\n\nElevate your Function as a Service (FaaS) development with enhanced security at the edge using `@autosec/fetchhole`. This package acts as a sophisticated drop-in replacement for the native `fetch()` function, tailored for developers who emphasize security in their web applications.\n\n## Features\n\n-   **Drop-in Replacement**: Seamlessly integrates with existing code, replacing the native `fetch()` function.\n-   **Advanced Logging**: Comprehensive logging capabilities for effective debugging.\n-   **Redirect Intercept**: Customize redirect limits with a default of 20, as per the WHATWG Fetch specification.\n-   **Header Computation**: Automatically computes and adds missing `Content-Length` and `ETag` headers. Choose your preferred ETag hash algorithm, with `sha256` as the default.\n-   **Cache Support**: Utilizes memory or disk caching via the Cache Web API. Compatible with Cloudflare's cache API for Cloudflare users.\n-   **Intercept for Alternate Routing**: Ideal for scenarios like Cloudflare Workers Binding, allowing for alternate request routing.\n-   **Custom DNS Resolver Support**: Designed for DNS level security applications like Zero Trust services. Compatible with any DoH resolver that uses `0.0.0.0` for blocking.\n    -   **Direct IP Address Handling**: Offers three modes for handling direct IP address access:\n        -   Full Block\n        -   Fail if No PTR Record (conducts a PTR record check, followed by a standard DNS check)\n        -   Allow\n\n## Supported Environments\n\n-   [x] NodeJS v16.15.0 or later (that's when NodeJS got native `fetch()` support) environments\n-   [ ] Browser support\n-   [x] Cloudflare Workers/Pages with `compatibility_flags = [ \"nodejs_compat\" ]` (not to be confused with `node_compat = true`)\n    > [!NOTE]\n    > When Browser support lands, it's still recommended to use `nodejs_compat` because those apis run faster and are more robust\n\n## Installation\n\n```bash\nnpm install @autosec/fetchhole\n```\n\n## Usage\n\nSimply import fetchhole and use it as a replacement for the native fetch() function.\n\n```ts\n// TODO\n```\n\n## Configuration\n\nYou can customize fetchhole with various options to suit your needs. Settings can be applied at the class instance level or as an fetch init property:\n\n```ts\n{\n\tcache: {\n\t\ttype: CacheType.Default, // Defines cache type\n\t\thashAlgorithm: 'sha256', // Choose a different ETag hash algorithm\n\t\tignoreMethod: false,\n\t\tignoreSearch: false,\n\t\tignoreVary: false,\n\t},\n\tdohServer: {\n\t\tprovider: 'https://dns.quad9.net/dns-query', // The server used to run security check\n\t\textraHeaders: new Headers(), // Other headers needed by DoH server other than required by RFC 8484\n\t\ttimeout: 2 * 1000, // Timeout in milliseconds to wait for a DNS query to resolve\n\t},\n\thardFail: true, // Determines failure handling\n\tip: {\n\t\tpolicy: IPBlockMode.BlockIfNxPTR,\n\t\tptrDohServer: {\n\t\t\tprovider: 'https://dns.google/dns-query', // The server used to perform PTR lookups, not security checks\n\t\t\textraHeaders: new Headers(), // Other headers needed by DoH server other than required by RFC 8484\n\t\t\ttimeout: 2 * 1000, // Timeout in milliseconds to wait for a DNS query to resolve\n\t\t},\n\t},\n\tlogLevel: LoggingLevel.INFO, // Sets the level of logging\n\tredirectCount: 20, // Set custom redirect limit\n}\n```\n","readmeFilename":"README.md","gitHead":"17096890f3aaa3d1684271f58cf9203b4bf916be","_nodeVersion":"20.10.0","_npmVersion":"10.2.3","dist":{"integrity":"sha512-XJm2Btp3xtXqbjAyuTj6Ey1q9+Zn1JBqKDCWS8zTEF1HY44B4MK1dTqePciS/CjoEeLND7S9lhgaqWxNWiXLyQ==","shasum":"8c7294af5308f8f4e3b0e7f5d8de2383fae6f6ae","tarball":"https://registry.npmjs.org/@autosec/fetchhole/-/fetchhole-0.1.1-nightly.13.tgz","fileCount":32,"unpackedSize":57441,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@autosec%2ffetchhole@0.1.1-nightly.13","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDv9+Cfsz7XpiI7px/2WiEqishRBzF0Agwbe5ERDvpn3gIhAOmPlE19OO+1SojKNmviaJz/jmTdwcubD0OoQTNmYop5"}]},"_npmUser":{"name":"demosjarco","email":"demosjarco@protonmail.com"},"directories":{},"maintainers":[{"name":"demosjarco","email":"demosjarco@protonmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetchhole_0.1.1-nightly.13_1703127496401_0.052854825957637575"},"_hasShrinkwrap":false},"0.1.1-nightly.14":{"name":"@autosec/fetchhole","version":"0.1.1-nightly.14","description":"Boost your FaaS development with fetchhole, a secure, drop-in replacement for the native `fetch()` function, designed for security-focused web developers.","type":"module","main":"./dist/index.mjs","types":"./dist/index.d.mts","scripts":{"build":"tsc","build:watch":"npm run build -- --watch","test":"node --loader ts-node/esm --test --test-reporter=spec"},"repository":{"type":"git","url":"git+https://github.com/autosec-network/FetchHole.git"},"author":{"name":"Autosec"},"contributors":[{"name":"DemosJarco","email":"1209494+demosjarco@users.noreply.github.com"},{"name":"Sam Gammon","email":"sam@elide.dev"}],"license":"MIT","bugs":{"url":"https://github.com/autosec-network/FetchHole/issues"},"homepage":"https://github.com/autosec-network/FetchHole#readme","engines":{"node":">=16.15.0"},"publishConfig":{"access":"public"},"exports":{".":"./dist/index.mjs"},"imports":{".":{"default":"./dist/index.mjs","types":"./dist/index.d.mts"}},"prettier":"@demosjarco/prettier-config","dependencies":{"chalk":"^5.3.0","dns-packet":"^5.6.1"},"devDependencies":{"@demosjarco/prettier-config":"^1.0.1","@swc/core":"^1.3.99","@types/dns-packet":"^5.6.4","@types/node":"^20.9.2","prettier":"^3.1.0","ts-node":"^10.9.1","typescript":"^5.3.2"},"_id":"@autosec/fetchhole@0.1.1-nightly.14","readme":"[![License](https://img.shields.io/github/license/autosec-network/FetchHole)](LICENSE)\n[![TypeScript](https://badgen.net/npm/types/@autosec-network/FetchHole)](https://www.npmjs.com/package/@autosec/fetchhole)\n[![npm](https://img.shields.io/npm/v/@autosec-network/FetchHole)](https://www.npmjs.com/package/@autosec/fetchhole)\n[![npm](https://img.shields.io/npm/dm/@autosec-network/FetchHole)](https://www.npmjs.com/package/@autosec/fetchhole)\n[![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/autosec-network/FetchHole/badge)](https://securityscorecards.dev/viewer/?uri=github.com/autosec-network/FetchHole)\n[![Socket Badge](https://socket.dev/api/badge/npm/package/@autosec-network/FetchHole)](https://socket.dev/npm/package/@autosec-network/FetchHole)\n\n# FetchHole\n\nElevate your Function as a Service (FaaS) development with enhanced security at the edge using `@autosec/fetchhole`. This package acts as a sophisticated drop-in replacement for the native `fetch()` function, tailored for developers who emphasize security in their web applications.\n\n## Features\n\n-   **Drop-in Replacement**: Seamlessly integrates with existing code, replacing the native `fetch()` function.\n-   **Advanced Logging**: Comprehensive logging capabilities for effective debugging.\n-   **Redirect Intercept**: Customize redirect limits with a default of 20, as per the WHATWG Fetch specification.\n-   **Header Computation**: Automatically computes and adds missing `Content-Length` and `ETag` headers. Choose your preferred ETag hash algorithm, with `sha256` as the default.\n-   **Cache Support**: Utilizes memory or disk caching via the Cache Web API. Compatible with Cloudflare's cache API for Cloudflare users.\n-   **Intercept for Alternate Routing**: Ideal for scenarios like Cloudflare Workers Binding, allowing for alternate request routing.\n-   **Custom DNS Resolver Support**: Designed for DNS level security applications like Zero Trust services. Compatible with any DoH resolver that uses `0.0.0.0` for blocking.\n    -   **Direct IP Address Handling**: Offers three modes for handling direct IP address access:\n        -   Full Block\n        -   Fail if No PTR Record (conducts a PTR record check, followed by a standard DNS check)\n        -   Allow\n\n## Supported Environments\n\n-   [x] NodeJS v16.15.0 or later (that's when NodeJS got native `fetch()` support) environments\n-   [ ] Browser support\n-   [x] Cloudflare Workers/Pages with `compatibility_flags = [ \"nodejs_compat\" ]` (not to be confused with `node_compat = true`)\n    > [!NOTE]\n    > When Browser support lands, it's still recommended to use `nodejs_compat` because those apis run faster and are more robust\n\n## Installation\n\n```bash\nnpm install @autosec/fetchhole\n```\n\n## Usage\n\nSimply import fetchhole and use it as a replacement for the native fetch() function.\n\n```ts\n// TODO\n```\n\n## Configuration\n\nYou can customize fetchhole with various options to suit your needs. Settings can be applied at the class instance level or as an fetch init property:\n\n```ts\n{\n\tcache: {\n\t\ttype: CacheType.Default, // Defines cache type\n\t\thashAlgorithm: 'sha256', // Choose a different ETag hash algorithm\n\t\tignoreMethod: false,\n\t\tignoreSearch: false,\n\t\tignoreVary: false,\n\t},\n\tdohServer: {\n\t\tprovider: 'https://dns.quad9.net/dns-query', // The server used to run security check\n\t\textraHeaders: new Headers(), // Other headers needed by DoH server other than required by RFC 8484\n\t\ttimeout: 2 * 1000, // Timeout in milliseconds to wait for a DNS query to resolve\n\t},\n\thardFail: true, // Determines failure handling\n\tip: {\n\t\tpolicy: IPBlockMode.BlockIfNxPTR,\n\t\tptrDohServer: {\n\t\t\tprovider: 'https://dns.google/dns-query', // The server used to perform PTR lookups, not security checks\n\t\t\textraHeaders: new Headers(), // Other headers needed by DoH server other than required by RFC 8484\n\t\t\ttimeout: 2 * 1000, // Timeout in milliseconds to wait for a DNS query to resolve\n\t\t},\n\t},\n\tlogLevel: LoggingLevel.INFO, // Sets the level of logging\n\tredirectCount: 20, // Set custom redirect limit\n}\n```\n","readmeFilename":"README.md","gitHead":"5dd028508f33761049daa15b01903d58f2581a65","_nodeVersion":"20.10.0","_npmVersion":"10.2.3","dist":{"integrity":"sha512-kmfUiTfQ+cbZBLOoBqaJNne90aSpmti4T4snAF1vDULCKZG6TkwDMFhJA5apAmHOxpziRUGiQ7F17SdO29ABVQ==","shasum":"1fb24eec8eb16f73be12a27c07012000fbff7067","tarball":"https://registry.npmjs.org/@autosec/fetchhole/-/fetchhole-0.1.1-nightly.14.tgz","fileCount":32,"unpackedSize":57577,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@autosec%2ffetchhole@0.1.1-nightly.14","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIB23bGwnp+mLP85tgoKmEXBMpXY3nQBqYZPvfljGd1m1AiBRe7aIBFkxzetZX1dFxC3shQKkP1WDFMGyr7589cB5OQ=="}]},"_npmUser":{"name":"demosjarco","email":"demosjarco@protonmail.com"},"directories":{},"maintainers":[{"name":"demosjarco","email":"demosjarco@protonmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetchhole_0.1.1-nightly.14_1703129739482_0.14345541210134916"},"_hasShrinkwrap":false},"0.1.1-nightly.15":{"name":"@autosec/fetchhole","version":"0.1.1-nightly.15","description":"Boost your FaaS development with fetchhole, a secure, drop-in replacement for the native `fetch()` function, designed for security-focused web developers.","type":"module","main":"./dist/index.mjs","types":"./dist/index.d.mts","scripts":{"build":"tsc","build:watch":"npm run build -- --watch","test":"node --loader ts-node/esm --test --test-reporter=spec"},"repository":{"type":"git","url":"git+https://github.com/autosec-network/FetchHole.git"},"author":{"name":"Autosec"},"contributors":[{"name":"DemosJarco","email":"1209494+demosjarco@users.noreply.github.com"},{"name":"Sam Gammon","email":"sam@elide.dev"}],"license":"MIT","bugs":{"url":"https://github.com/autosec-network/FetchHole/issues"},"homepage":"https://github.com/autosec-network/FetchHole#readme","engines":{"node":">=16.15.0"},"publishConfig":{"access":"public"},"exports":{".":"./dist/index.mjs"},"imports":{".":{"default":"./dist/index.mjs","types":"./dist/index.d.mts"}},"prettier":"@demosjarco/prettier-config","dependencies":{"chalk":"^5.3.0","dns-packet":"^5.6.1"},"devDependencies":{"@demosjarco/prettier-config":"^1.0.1","@swc/core":"^1.3.99","@types/dns-packet":"^5.6.4","@types/node":"^20.9.2","prettier":"^3.1.0","ts-node":"^10.9.1","typescript":"^5.3.2"},"_id":"@autosec/fetchhole@0.1.1-nightly.15","readme":"[![License](https://img.shields.io/github/license/autosec-network/FetchHole)](LICENSE)\n[![TypeScript](https://badgen.net/npm/types/@autosec-network/FetchHole)](https://www.npmjs.com/package/@autosec/fetchhole)\n[![npm](https://img.shields.io/npm/v/@autosec-network/FetchHole)](https://www.npmjs.com/package/@autosec/fetchhole)\n[![npm](https://img.shields.io/npm/dm/@autosec-network/FetchHole)](https://www.npmjs.com/package/@autosec/fetchhole)\n[![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/autosec-network/FetchHole/badge)](https://securityscorecards.dev/viewer/?uri=github.com/autosec-network/FetchHole)\n[![Socket Badge](https://socket.dev/api/badge/npm/package/@autosec-network/FetchHole)](https://socket.dev/npm/package/@autosec-network/FetchHole)\n\n# FetchHole\n\nElevate your Function as a Service (FaaS) development with enhanced security at the edge using `@autosec/fetchhole`. This package acts as a sophisticated drop-in replacement for the native `fetch()` function, tailored for developers who emphasize security in their web applications.\n\n## Features\n\n-   **Drop-in Replacement**: Seamlessly integrates with existing code, replacing the native `fetch()` function.\n-   **Advanced Logging**: Comprehensive logging capabilities for effective debugging.\n-   **Redirect Intercept**: Customize redirect limits with a default of 20, as per the WHATWG Fetch specification.\n-   **Header Computation**: Automatically computes and adds missing `Content-Length` and `ETag` headers. Choose your preferred ETag hash algorithm, with `sha256` as the default.\n-   **Cache Support**: Utilizes memory or disk caching via the Cache Web API. Compatible with Cloudflare's cache API for Cloudflare users.\n-   **Intercept for Alternate Routing**: Ideal for scenarios like Cloudflare Workers Binding, allowing for alternate request routing.\n-   **Custom DNS Resolver Support**: Designed for DNS level security applications like Zero Trust services. Compatible with any DoH resolver that uses `0.0.0.0` for blocking.\n    -   **Direct IP Address Handling**: Offers three modes for handling direct IP address access:\n        -   Full Block\n        -   Fail if No PTR Record (conducts a PTR record check, followed by a standard DNS check)\n        -   Allow\n\n## Supported Environments\n\n-   [x] NodeJS v16.15.0 or later (that's when NodeJS got native `fetch()` support) environments\n-   [ ] Browser support\n-   [x] Cloudflare Workers/Pages with `compatibility_flags = [ \"nodejs_compat\" ]` (not to be confused with `node_compat = true`)\n    > [!NOTE]\n    > When Browser support lands, it's still recommended to use `nodejs_compat` because those apis run faster and are more robust\n\n## Installation\n\n```bash\nnpm install @autosec/fetchhole\n```\n\n## Usage\n\nSimply import fetchhole and use it as a replacement for the native fetch() function.\n\n```ts\n// TODO\n```\n\n## Configuration\n\nYou can customize fetchhole with various options to suit your needs. Settings can be applied at the class instance level or as an fetch init property:\n\n```ts\n{\n\tcache: {\n\t\ttype: CacheType.Default, // Defines cache type\n\t\thashAlgorithm: 'sha256', // Choose a different ETag hash algorithm\n\t\tignoreMethod: false,\n\t\tignoreSearch: false,\n\t\tignoreVary: false,\n\t},\n\tdohServer: {\n\t\tprovider: 'https://dns.quad9.net/dns-query', // The server used to run security check\n\t\textraHeaders: new Headers(), // Other headers needed by DoH server other than required by RFC 8484\n\t\ttimeout: 2 * 1000, // Timeout in milliseconds to wait for a DNS query to resolve\n\t},\n\thardFail: true, // Determines failure handling\n\tip: {\n\t\tpolicy: IPBlockMode.BlockIfNxPTR,\n\t\tptrDohServer: {\n\t\t\tprovider: 'https://dns.google/dns-query', // The server used to perform PTR lookups, not security checks\n\t\t\textraHeaders: new Headers(), // Other headers needed by DoH server other than required by RFC 8484\n\t\t\ttimeout: 2 * 1000, // Timeout in milliseconds to wait for a DNS query to resolve\n\t\t},\n\t},\n\tlogLevel: LoggingLevel.INFO, // Sets the level of logging\n\tredirectCount: 20, // Set custom redirect limit\n}\n```\n","readmeFilename":"README.md","gitHead":"dc8aa5b3b71a5253792b98a5277e0da27991f409","_nodeVersion":"20.10.0","_npmVersion":"10.2.3","dist":{"integrity":"sha512-pHs1P/iJnOaET61FYYjrWT+6oZ+jqjJpTEOuVoUHaeXM5O45taIQN62OKlrEo28LQcNfL0fgvYXmoP9VuOX8IQ==","shasum":"87643374ccc212e5c23f5c2c97cbcb334a9e2014","tarball":"https://registry.npmjs.org/@autosec/fetchhole/-/fetchhole-0.1.1-nightly.15.tgz","fileCount":32,"unpackedSize":57615,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@autosec%2ffetchhole@0.1.1-nightly.15","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGzDGjPws3mJOL89AvcrVikB1bcdzYdMokIYYMmg8KzeAiEAxKQvEW0I0FyV1y+XXe1DfH7WHdCu4HD1xCodMn5K/4s="}]},"_npmUser":{"name":"demosjarco","email":"demosjarco@protonmail.com"},"directories":{},"maintainers":[{"name":"demosjarco","email":"demosjarco@protonmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetchhole_0.1.1-nightly.15_1703130716623_0.7944757158866993"},"_hasShrinkwrap":false},"0.1.1-nightly.16":{"name":"@autosec/fetchhole","version":"0.1.1-nightly.16","description":"Boost your FaaS development with fetchhole, a secure, drop-in replacement for the native `fetch()` function, designed for security-focused web developers.","type":"module","main":"./dist/index.mjs","types":"./dist/index.d.mts","scripts":{"build":"tsc","build:watch":"npm run build -- --watch","test":"node --loader ts-node/esm --test --test-reporter=spec"},"repository":{"type":"git","url":"git+https://github.com/autosec-network/FetchHole.git"},"author":{"name":"Autosec"},"contributors":[{"name":"DemosJarco","email":"1209494+demosjarco@users.noreply.github.com"},{"name":"Sam Gammon","email":"sam@elide.dev"}],"license":"MIT","bugs":{"url":"https://github.com/autosec-network/FetchHole/issues"},"homepage":"https://github.com/autosec-network/FetchHole#readme","engines":{"node":">=16.15.0"},"publishConfig":{"access":"public"},"exports":{".":"./dist/index.mjs"},"imports":{".":{"default":"./dist/index.mjs","types":"./dist/index.d.mts"}},"prettier":"@demosjarco/prettier-config","dependencies":{"chalk":"^5.3.0","dns-packet":"^5.6.1"},"devDependencies":{"@demosjarco/prettier-config":"^1.0.1","@swc/core":"^1.3.99","@types/dns-packet":"^5.6.4","@types/node":"^20.9.2","prettier":"^3.1.0","ts-node":"^10.9.1","typescript":"^5.3.2"},"_id":"@autosec/fetchhole@0.1.1-nightly.16","readme":"[![License](https://img.shields.io/github/license/autosec-network/FetchHole)](LICENSE)\n[![TypeScript](https://badgen.net/npm/types/@autosec-network/FetchHole)](https://www.npmjs.com/package/@autosec/fetchhole)\n[![npm](https://img.shields.io/npm/v/@autosec-network/FetchHole)](https://www.npmjs.com/package/@autosec/fetchhole)\n[![npm](https://img.shields.io/npm/dm/@autosec-network/FetchHole)](https://www.npmjs.com/package/@autosec/fetchhole)\n[![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/autosec-network/FetchHole/badge)](https://securityscorecards.dev/viewer/?uri=github.com/autosec-network/FetchHole)\n[![Socket Badge](https://socket.dev/api/badge/npm/package/@autosec-network/FetchHole)](https://socket.dev/npm/package/@autosec-network/FetchHole)\n\n# FetchHole\n\nElevate your Function as a Service (FaaS) development with enhanced security at the edge using `@autosec/fetchhole`. This package acts as a sophisticated drop-in replacement for the native `fetch()` function, tailored for developers who emphasize security in their web applications.\n\n## Features\n\n-   **Drop-in Replacement**: Seamlessly integrates with existing code, replacing the native `fetch()` function.\n-   **Advanced Logging**: Comprehensive logging capabilities for effective debugging.\n-   **Redirect Intercept**: Customize redirect limits with a default of 20, as per the WHATWG Fetch specification.\n-   **Header Computation**: Automatically computes and adds missing `Content-Length` and `ETag` headers. Choose your preferred ETag hash algorithm, with `sha256` as the default.\n-   **Cache Support**: Utilizes memory or disk caching via the Cache Web API. Compatible with Cloudflare's cache API for Cloudflare users.\n-   **Intercept for Alternate Routing**: Ideal for scenarios like Cloudflare Workers Binding, allowing for alternate request routing.\n-   **Custom DNS Resolver Support**: Designed for DNS level security applications like Zero Trust services. Compatible with any DoH resolver that uses `0.0.0.0` for blocking.\n    -   **Direct IP Address Handling**: Offers three modes for handling direct IP address access:\n        -   Full Block\n        -   Fail if No PTR Record (conducts a PTR record check, followed by a standard DNS check)\n        -   Allow\n\n## Supported Environments\n\n-   [x] NodeJS v16.15.0 or later (that's when NodeJS got native `fetch()` support) environments\n-   [ ] Browser support\n-   [x] Cloudflare Workers/Pages with `compatibility_flags = [ \"nodejs_compat\" ]` (not to be confused with `node_compat = true`)\n    > [!NOTE]\n    > When Browser support lands, it's still recommended to use `nodejs_compat` because those apis run faster and are more robust\n\n## Installation\n\n```bash\nnpm install @autosec/fetchhole\n```\n\n## Usage\n\nSimply import fetchhole and use it as a replacement for the native fetch() function.\n\n```ts\n// TODO\n```\n\n## Configuration\n\nYou can customize fetchhole with various options to suit your needs. Settings can be applied at the class instance level or as an fetch init property:\n\n```ts\n{\n\tcache: {\n\t\ttype: CacheType.Default, // Defines cache type\n\t\thashAlgorithm: 'sha256', // Choose a different ETag hash algorithm\n\t\tignoreMethod: false,\n\t\tignoreSearch: false,\n\t\tignoreVary: false,\n\t},\n\tdohServer: {\n\t\tprovider: 'https://dns.quad9.net/dns-query', // The server used to run security check\n\t\textraHeaders: new Headers(), // Other headers needed by DoH server other than required by RFC 8484\n\t\ttimeout: 2 * 1000, // Timeout in milliseconds to wait for a DNS query to resolve\n\t},\n\thardFail: true, // Determines failure handling\n\tip: {\n\t\tpolicy: IPBlockMode.BlockIfNxPTR,\n\t\tptrDohServer: {\n\t\t\tprovider: 'https://dns.google/dns-query', // The server used to perform PTR lookups, not security checks\n\t\t\textraHeaders: new Headers(), // Other headers needed by DoH server other than required by RFC 8484\n\t\t\ttimeout: 2 * 1000, // Timeout in milliseconds to wait for a DNS query to resolve\n\t\t},\n\t},\n\tlogLevel: LoggingLevel.INFO, // Sets the level of logging\n\tredirectCount: 20, // Set custom redirect limit\n}\n```\n","readmeFilename":"README.md","gitHead":"17b3b4a72840ce842a700b98db1949aa5852fd06","_nodeVersion":"20.10.0","_npmVersion":"10.2.3","dist":{"integrity":"sha512-kotxnmOPgFYBTOipCW6OM/YqIVFPKNVSTrgVdOMa3R9JfWM8u03aSJvydbHSYxickqIGtLEI9nnn3CFkKQDq3g==","shasum":"3b530340683f0f25c2515f944a2dccbbe32ca102","tarball":"https://registry.npmjs.org/@autosec/fetchhole/-/fetchhole-0.1.1-nightly.16.tgz","fileCount":32,"unpackedSize":57615,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@autosec%2ffetchhole@0.1.1-nightly.16","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCSu63HPwdT0RbtPzhFgsivStGqGJyGTsTXph2tDsTBsAIgFIVBBNg3/N7hkZYYTP1+c80QDTpNw0bSue2vJTefoho="}]},"_npmUser":{"name":"demosjarco","email":"demosjarco@protonmail.com"},"directories":{},"maintainers":[{"name":"demosjarco","email":"demosjarco@protonmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetchhole_0.1.1-nightly.16_1703131088788_0.8615390786961592"},"_hasShrinkwrap":false},"0.1.1-nightly.17":{"name":"@autosec/fetchhole","version":"0.1.1-nightly.17","description":"Boost your FaaS development with fetchhole, a secure, drop-in replacement for the native `fetch()` function, designed for security-focused web developers.","type":"module","main":"./dist/index.mjs","types":"./dist/index.d.mts","scripts":{"build":"tsc","build:watch":"npm run build -- --watch","test":"node --loader ts-node/esm --test --test-reporter=spec"},"repository":{"type":"git","url":"git+https://github.com/autosec-network/FetchHole.git"},"author":{"name":"Autosec"},"contributors":[{"name":"DemosJarco","email":"1209494+demosjarco@users.noreply.github.com"},{"name":"Sam Gammon","email":"sam@elide.dev"}],"license":"MIT","bugs":{"url":"https://github.com/autosec-network/FetchHole/issues"},"homepage":"https://github.com/autosec-network/FetchHole#readme","engines":{"node":">=16.15.0"},"publishConfig":{"access":"public"},"exports":{".":"./dist/index.mjs"},"imports":{".":{"default":"./dist/index.mjs","types":"./dist/index.d.mts"}},"prettier":"@demosjarco/prettier-config","dependencies":{"@leichtgewicht/ip-codec":"^2.0.4","chalk":"^5.3.0"},"devDependencies":{"@demosjarco/prettier-config":"^1.0.1","@swc/core":"^1.3.99","@types/dns-packet":"^5.6.4","@types/node":"^20.9.2","prettier":"^3.1.0","ts-node":"^10.9.1","typescript":"^5.3.2"},"_id":"@autosec/fetchhole@0.1.1-nightly.17","readme":"[![License](https://img.shields.io/github/license/autosec-network/FetchHole)](LICENSE)\n[![TypeScript](https://badgen.net/npm/types/@autosec-network/FetchHole)](https://www.npmjs.com/package/@autosec/fetchhole)\n[![npm](https://img.shields.io/npm/v/@autosec-network/FetchHole)](https://www.npmjs.com/package/@autosec/fetchhole)\n[![npm](https://img.shields.io/npm/dm/@autosec-network/FetchHole)](https://www.npmjs.com/package/@autosec/fetchhole)\n[![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/autosec-network/FetchHole/badge)](https://securityscorecards.dev/viewer/?uri=github.com/autosec-network/FetchHole)\n[![Socket Badge](https://socket.dev/api/badge/npm/package/@autosec-network/FetchHole)](https://socket.dev/npm/package/@autosec-network/FetchHole)\n\n# FetchHole\n\nElevate your Function as a Service (FaaS) development with enhanced security at the edge using `@autosec/fetchhole`. This package acts as a sophisticated drop-in replacement for the native `fetch()` function, tailored for developers who emphasize security in their web applications.\n\n## Features\n\n-   **Drop-in Replacement**: Seamlessly integrates with existing code, replacing the native `fetch()` function.\n-   **Advanced Logging**: Comprehensive logging capabilities for effective debugging.\n-   **Redirect Intercept**: Customize redirect limits with a default of 20, as per the WHATWG Fetch specification.\n-   **Header Computation**: Automatically computes and adds missing `Content-Length` and `ETag` headers. Choose your preferred ETag hash algorithm, with `sha256` as the default.\n-   **Cache Support**: Utilizes memory or disk caching via the Cache Web API. Compatible with Cloudflare's cache API for Cloudflare users.\n-   **Intercept for Alternate Routing**: Ideal for scenarios like Cloudflare Workers Binding, allowing for alternate request routing.\n-   **Custom DNS Resolver Support**: Designed for DNS level security applications like Zero Trust services. Compatible with any DoH resolver that uses `0.0.0.0` for blocking.\n    -   **Direct IP Address Handling**: Offers three modes for handling direct IP address access:\n        -   Full Block\n        -   Fail if No PTR Record (conducts a PTR record check, followed by a standard DNS check)\n        -   Allow\n\n## Supported Environments\n\n-   [x] NodeJS v16.15.0 or later (that's when NodeJS got native `fetch()` support) environments\n-   [ ] Browser support\n-   [x] Cloudflare Workers/Pages with `compatibility_flags = [ \"nodejs_compat\" ]` (not to be confused with `node_compat = true`)\n    > [!NOTE]\n    > When Browser support lands, it's still recommended to use `nodejs_compat` because those apis run faster and are more robust\n\n## Installation\n\n```bash\nnpm install @autosec/fetchhole\n```\n\n## Usage\n\nSimply import fetchhole and use it as a replacement for the native fetch() function.\n\n```ts\n// TODO\n```\n\n## Configuration\n\nYou can customize fetchhole with various options to suit your needs. Settings can be applied at the class instance level or as an fetch init property:\n\n```ts\n{\n\tcache: {\n\t\ttype: CacheType.Default, // Defines cache type\n\t\thashAlgorithm: 'sha256', // Choose a different ETag hash algorithm\n\t\tignoreMethod: false,\n\t\tignoreSearch: false,\n\t\tignoreVary: false,\n\t},\n\tdohServer: {\n\t\tprovider: 'https://dns.quad9.net/dns-query', // The server used to run security check\n\t\textraHeaders: new Headers(), // Other headers needed by DoH server other than required by RFC 8484\n\t\ttimeout: 2 * 1000, // Timeout in milliseconds to wait for a DNS query to resolve\n\t},\n\thardFail: true, // Determines failure handling\n\tip: {\n\t\tpolicy: IPBlockMode.BlockIfNxPTR,\n\t\tptrDohServer: {\n\t\t\tprovider: 'https://dns.google/dns-query', // The server used to perform PTR lookups, not security checks\n\t\t\textraHeaders: new Headers(), // Other headers needed by DoH server other than required by RFC 8484\n\t\t\ttimeout: 2 * 1000, // Timeout in milliseconds to wait for a DNS query to resolve\n\t\t},\n\t},\n\tlogLevel: LoggingLevel.INFO, // Sets the level of logging\n\tredirectCount: 20, // Set custom redirect limit\n}\n```\n","readmeFilename":"README.md","gitHead":"172806eeeb4c26555ab3581b7abc8ac6a0edaad5","_nodeVersion":"20.10.0","_npmVersion":"10.2.3","dist":{"integrity":"sha512-8sOf7KFGZnxRymWDVbWCxfP/3gR2vIANRQ9HQtJHuXYrAH6FZMfp8DTMzcc4rZJvvUAB/iU+zj6VsvNciNonoQ==","shasum":"4cc7418f69f215751d70972cc55bb88f9930e0ac","tarball":"https://registry.npmjs.org/@autosec/fetchhole/-/fetchhole-0.1.1-nightly.17.tgz","fileCount":44,"unpackedSize":117449,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@autosec%2ffetchhole@0.1.1-nightly.17","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEQyU3UnBnvTk/C4R/DchpbkaRJkjUdJ5c1Isv3ocLEGAiEAlwhk8fYRKgoJRXpuSSrb2lf73Qp2rQXNmGhNy3ZvjRo="}]},"_npmUser":{"name":"demosjarco","email":"demosjarco@protonmail.com"},"directories":{},"maintainers":[{"name":"demosjarco","email":"demosjarco@protonmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetchhole_0.1.1-nightly.17_1703136720481_0.8553313765114885"},"_hasShrinkwrap":false}},"maintainers":[{"name":"demosjarco","email":"demosjarco@protonmail.com"}],"description":"Boost your FaaS development with `@autosec/fetchhole`, a secure, drop-in replacement for the native `fetch()` function, designed for security-focused web developers.","homepage":"https://github.com/autosec-network/FetchHole#readme","repository":{"type":"git","url":"git+https://github.com/autosec-network/FetchHole.git"},"contributors":[{"name":"DemosJarco","email":"1209494+demosjarco@users.noreply.github.com"},{"name":"Sam Gammon","email":"sam@elide.dev"}],"author":{"name":"Autosec"},"bugs":{"url":"https://github.com/autosec-network/FetchHole/issues"},"license":"MIT","readme":"","readmeFilename":""}