Nyro is a promise-based HTTP and HTTP/2 request library for JavaScript and TypeScript, currently stable at version 2.0.4. It offers comprehensive support for all HTTP methods and focuses on performance and flexibility, incorporating features like proxy support, request queueing, caching mechanisms, and built-in pagination APIs. The library provides robust error handling, retries, and configurable timeouts. While it ships with TypeScript types, it is primarily designed for Node.js environments. Its "browser support" refers to browser-like features within Node rather than client-side browser usage. The project appears actively maintained with recent updates and differentiates itself by providing advanced functionalities such as `bodySchema` for response validation and specialized proxy tools.
npm install nyroVerified import paths — ran on the pinned version, not inferred.
Demonstrates a basic promise-based GET request, including URL parameters, HTTP method, expected response type, custom headers, and response body schema validation using Nyro. It logs the status code and the parsed AI reply.
Migrate to ES module import syntax (`import ... from 'nyro';`) or use dynamic `import()` within CommonJS modules. Ensure your project's `package.json` specifies `"type": "module"` if it's an ESM project.
Do not attempt to use Nyro directly in a web browser. It is designed for server-side (Node.js) applications. For client-side, consider browser-native `fetch` or a dedicated browser-compatible HTTP client.
The actual data payload should be passed via the `body` option. Use `bodySchema` purely for validation against a JavaScript type constructor (e.g., `String`, `Number`, `Object`, `Array`) or custom validation functions.
Exercise extreme caution and ensure legal and ethical compliance when using any features that could be construed as attack-oriented. Only use such features in controlled, authorized environments for legitimate security research or testing.
For ESM, ensure `import nyro from 'nyro';` is used. For CommonJS, if the library is ESM-only in v2+, you might need `const { default: nyro } = await import('nyro');` or configure your environment for ESM.Either convert your consuming module to ESM by adding `"type": "module"` to your `package.json` and using `import` statements, or use a dynamic import: `const { default: nyro } = await import('nyro');`.Ensure `bodySchema` correctly reflects the expected runtime shape of the response body. If the schema is dynamic or very complex, you might need to manually assert the type: `const { body } = await nyro(...) as { body: ExpectedBodyType };`Ensure your proxy agent (e.g., `http-proxy-agent`, `https-proxy-agent`, `socks-proxy-agent`) matches the protocol of your proxy server. Also, verify that the `url` in your Nyro request matches the protocol expected by the agent.
No dependency data recorded yet.