{"id":22092176,"url":"https://github.com/pirxpilot/getlet","last_synced_at":"2025-06-23T16:05:13.344Z","repository":{"id":13467339,"uuid":"16157262","full_name":"pirxpilot/getlet","owner":"pirxpilot","description":"HTTP(s) get request with redirect, compress and streaming","archived":false,"fork":false,"pushed_at":"2024-11-27T22:45:32.000Z","size":37,"stargazers_count":2,"open_issues_count":1,"forks_count":0,"subscribers_count":4,"default_branch":"main","last_synced_at":"2024-11-27T22:51:30.781Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pirxpilot.png","metadata":{"files":{"readme":"Readme.md","changelog":"History.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-01-23T00:25:01.000Z","updated_at":"2024-11-27T22:45:36.000Z","dependencies_parsed_at":"2022-09-01T05:41:21.692Z","dependency_job_id":null,"html_url":"https://github.com/pirxpilot/getlet","commit_stats":null,"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pirxpilot%2Fgetlet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pirxpilot%2Fgetlet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pirxpilot%2Fgetlet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pirxpilot%2Fgetlet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pirxpilot","download_url":"https://codeload.github.com/pirxpilot/getlet/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":227476143,"owners_count":17779417,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":[],"created_at":"2024-12-01T03:08:36.509Z","updated_at":"2024-12-01T03:08:37.543Z","avatar_url":"https://github.com/pirxpilot.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![NPM version][npm-image]][npm-url]\n[![Build Status][build-image]][build-url]\n[![Dependency Status][deps-image]][deps-url]\n\n\n# getlet\n\nHTTP(s) request with redirect, compress and streaming\n\nTo be used if you only need bare bones HTTP request and if you'd rather have your response processed downstream.\n\n`getlet` will send the request, handle the redirects and pipe the response.\nIf you need anything more than this check [superagent] or [request].\n\n`getlet` always asks for `gzip` or `deflate` encoding and decompresses the response,\nbut it won't do any other processing. It won't buffer the responses in any way.\n\n## Examples\n\n```javascript\n  const getlet = require('getlet');\n\n  // get URL and stream it\n  getlet('http://google.com').pipe(stream);\n\n  // configure URL from host and part\n  getlet()\n    .host('raw2.github.com')\n    .path('/pirxpilot/liftie/master/.jshintrc')\n    .secure(true)\n    .on('error', errorHandler)\n    .pipe(stream);\n\n  // post some data\n  getlet('https//example.com/form')\n    .method('POST')\n    .send(formData)\n    .pipe(stream);\n\n  // get URL and stream it, initialize later\n  const request = getlet('http://google.com', false);\n  setTimeout(function () {\n    request.pipe(stream);\n    request.init();\n  }, 1000);\n  // initialize later\n\n```\n\n## API\n\n\n### `getlet(url, autoInit = true)`\n\n`url` is an optional parameter - alternatively you can configure target using `host` and `path`\n`autoInit` if false `init()` has to be called explicitly to trigger network request \n\n### `host(host)`\n\n### `path(path)`\n\n### `secure(on)`\n\nif `on` is truthy use HTTPS instead of HTTP\n\n### `userAgent(ua)`\n\nset `User-Agent` header\n\n### `header(name, value)`\n\nset header `name` to `value`, also accepts an object treated as `name` -\u003e `value`\n\n### `auth(username, password)`\n\nsets basic authentication `Authorization` header\n\n### `send(data)`\n\nsends `data` with the request\n\n### `method(method)`\n\nuses HTTP `method` (`POST`, `PUT` etc) - `GET` is used if `method` is not called\n\n### `followRedirects(boolean)`\n\nwhen called with `false` will prevent getlet from automatically following redirects\n\n[request]: https://github.com/mikeal/request\n[superagent]: http://visionmedia.github.io/superagent/\n\n[npm-image]: https://img.shields.io/npm/v/getlet\n[npm-url]: https://npmjs.org/package/getlet\n\n[build-image]: https://img.shields.io/github/actions/workflow/status/pirxpilot/getlet/check.yaml?branch=main\n[build-url]: https://github.com/pirxpilot/getlet/actions/workflows/check.yaml\n\n[deps-image]: https://img.shields.io/librariesio/release/npm/getlet\n[deps-url]: https://libraries.io/npm/getlet\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpirxpilot%2Fgetlet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpirxpilot%2Fgetlet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpirxpilot%2Fgetlet/lists"}