{"id":19755052,"url":"https://github.com/zisra/atlantica","last_synced_at":"2026-05-16T13:31:16.224Z","repository":{"id":65712676,"uuid":"597962762","full_name":"zisra/atlantica","owner":"zisra","description":"Simple and easy-to-use requests in Node.js","archived":false,"fork":false,"pushed_at":"2023-04-05T05:47:00.000Z","size":106,"stargazers_count":2,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-22T14:37:31.594Z","etag":null,"topics":["fetch","http","http-client","https","node","node-js","nodejs","request","rest"],"latest_commit_sha":null,"homepage":"https://npm.im/atlantica","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zisra.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-02-06T04:55:28.000Z","updated_at":"2024-10-29T22:28:13.000Z","dependencies_parsed_at":"2025-03-01T06:00:32.347Z","dependency_job_id":null,"html_url":"https://github.com/zisra/atlantica","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/zisra/atlantica","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zisra%2Fatlantica","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zisra%2Fatlantica/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zisra%2Fatlantica/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zisra%2Fatlantica/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zisra","download_url":"https://codeload.github.com/zisra/atlantica/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zisra%2Fatlantica/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33104409,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-16T04:41:52.686Z","status":"ssl_error","status_checked_at":"2026-05-16T04:41:52.009Z","response_time":115,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["fetch","http","http-client","https","node","node-js","nodejs","request","rest"],"created_at":"2024-11-12T03:08:10.624Z","updated_at":"2026-05-16T13:31:16.208Z","avatar_url":"https://github.com/zisra.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# [Atlantica](https://www.npmjs.com/package/atlantica)\n\nSimple and easy-to-use requests in Node.js\n\n## Installation\n\n```sh\nnpm install atlantica\nyarn add atlantica\npnpm add atlantica\n```\n\n## Usage\n\n\u003e The following functions should be in an async context\n\nThe package returns a function by default. You can use this to initialize a request, and you can specify none, one, or two options.\n\n```ts\nimport atlantica from 'atlanica';\nconst request = atlantica('http://httpbin.org', options);\n```\n\nYou can also use the `Request` class instead\n\n```ts\nimport { Request } from 'atlanica';\nconst request = new Request('http://httpbin.org', options);\n```\n\nUsing the returned value from this function (or class), you can specify options and send your request\n\n### Response types\n\n```ts\nrequest.type('full'); // Returns a full response object\n/*\n{\n    httpResponse, // Raw HTTP response\n    headers, // Headers\n    statusCode, // Status code\n    statusMessage, // Status message\n    body, // Response body (Use .text or .blob, etc. on .body)\n}\n*/\nrequest.response('text');\nrequest.response('json'); // Attempts to parse JSON\nrequest.response('buffer');\nrequest.response('blob');\nrequest.response('arrayBuffer');\nrequest.response('stream'); // Can be used to .pipe() response\n```\n\nYou can also use the exported `ResponseType` enum to specify the response type\n\n```js\nimport atlantica, { ResponseType } from 'atlanica';\nrequest.response(ResponseType.TEXT);\nrequest.response(ResponseType.JSON);\n```\n\n### More options\n\n```ts\nrequest.url('http://httpbin.org/anything'); // Set URL\nrequest.path('anything'); // Set URL\nrequest.query({ query: 'Node.js' }); // Query parameters\nrequest.method('put'); // Set the HTTP method\nrequest.body('body'); // Set data to the server\nrequest.body('body'); // Send JSON data and the content-type to application/json\nrequest.headers({ query: 'Node.js' }); // Set headers\nrequest.timeout(100); // Request timeout\nrequest.maxRedirects(10); // Maximum redirects to follow (default is 5), (set to 0 to disable redirects)\nrequest.maxSize(); // Set the maximum response size in bytes\nrequest.throwErrors() // Whether to throw an error if the response is not within the 200 range\nrequest.compression(true) // Whether to support compression or not\nreguest.rootOptions(); // Set root HTTP//HTTPS options\n```\n\n### Send the request\n\n```ts\nrequest.send();\n```\n\nThe following shortcuts set the method, url or path, options, and send the request all in one go\n\n```ts\nrequest.get('/get', options);\nrequest.get('http://httpbin.org/image/png', options);\nrequest.post('/post', options);\n// Supported methods:\n// get, head, post, put, delete, connect, options, trace, patch\n```\n\nIn order to actually read the response data of a request, you must read value returned by the promise. It will come in whatever response type you chose.\n\n```ts\nconst response = await request.send();\nconsole.log(response);\n```\n\n### Options object\n\n```ts\n{\n    url,\n    path,\n    query,\n    method,\n    body,\n    headers,\n    timeout,\n    response,\n    maxRedirects,\n    maxSize,\n    throwErrors,\n    compression,\n    rootOptions,\n}\n```\n\n### Errors\n\n```ts\nnew Error('Invalid response type'); // Thrown when when none of the response types are selected\nnew Error('Timeout reached'); // Thrown when the timeout exceeds the milliseconds the server took to respond.\nnew Error('Body over maximum size'); // Thrown when the maximum body size is exceeded\nnew Error('Server aborted request'); // Server aborted request\nnew Error('No URL provided to the request'); // No valid is provided\nnew Error('Invalid query'); // Invalid or falsy query\nnew Error('Invalid headers'); // Invalid or falsy headers\n```\n\n## Contribute\n\nContributions will be appreciated. Follow these steps to contribute:\n\n1. Clone the repository\n2. Make your changes\n3. Run `npm test` and make sure all the tests passed\n4. Run `npm run format` to automatically format all the code using prettier\n5. Run `npm lint` to fix code style errors.\n6. Create a PR, and wait for a response\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzisra%2Fatlantica","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzisra%2Fatlantica","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzisra%2Fatlantica/lists"}