{"id":31765123,"url":"https://github.com/trose/trimp","last_synced_at":"2026-05-14T21:35:28.960Z","repository":{"id":316337484,"uuid":"1062798666","full_name":"trose/trimp","owner":"trose","description":"🪞TRIMP (Typescript Requests IMPersonate). The fastest typescript HTTP client that can impersonate web browsers. Port of https://github.com/deedy5/primp","archived":false,"fork":false,"pushed_at":"2025-09-24T02:05:43.000Z","size":15976,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-10-10T00:18:21.221Z","etag":null,"topics":["akamai","ja3","ja4","tls","typescript","zod"],"latest_commit_sha":null,"homepage":"","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/trose.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null}},"created_at":"2025-09-23T18:38:42.000Z","updated_at":"2025-09-25T18:40:44.000Z","dependencies_parsed_at":"2025-09-24T03:22:56.186Z","dependency_job_id":"97e1a601-5b98-49f9-ba77-7eab08e8c992","html_url":"https://github.com/trose/trimp","commit_stats":null,"previous_names":["trose/trimp"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/trose/trimp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trose%2Ftrimp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trose%2Ftrimp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trose%2Ftrimp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trose%2Ftrimp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/trose","download_url":"https://codeload.github.com/trose/trimp/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trose%2Ftrimp/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33044248,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-13T13:14:54.681Z","status":"online","status_checked_at":"2026-05-14T02:00:06.663Z","response_time":57,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["akamai","ja3","ja4","tls","typescript","zod"],"created_at":"2025-10-10T00:13:27.405Z","updated_at":"2026-05-14T21:35:28.920Z","avatar_url":"https://github.com/trose.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# TrimpTS\n\nA TypeScript HTTP client library with browser impersonation capabilities for Node.js.\n\n## Features\n\n- **Browser Impersonation**: Mimic Chrome, Safari, Edge, Firefox, and OkHttp across different operating systems\n- **TypeScript Support**: Full TypeScript definitions and type safety\n- **Promise-based API**: Modern async/await support\n- **Comprehensive HTTP Methods**: GET, POST, PUT, PATCH, DELETE, HEAD, OPTIONS\n- **Authentication**: Support for Basic Auth and Bearer tokens\n- **SSL/TLS**: Configurable SSL options including custom certificates\n- **Cookies**: Automatic cookie handling\n- **Timeouts**: Configurable request timeouts\n- **Error Handling**: Robust error handling with custom error types\n\n## Installation\n\n```bash\nnpm install trimpts\n```\n\n## Quick Start\n\n```typescript\nimport { AsyncClient } from 'trimpts';\n\n// Create a client with browser impersonation\nconst client = new AsyncClient({\n  impersonate: 'chrome',\n  impersonate_os: 'windows'\n});\n\n// Make a simple GET request\nconst response = await client.get('https://api.example.com/users');\nconsole.log(response.json());\n```\n\n## API Reference\n\n### Client Classes\n\n#### `AsyncClient`\n\nPromise-based HTTP client with async/await support.\n\n```typescript\nconst client = new AsyncClient(options);\n```\n\n#### `Client`\n\nCallback-based HTTP client.\n\n```typescript\nconst client = new Client(options);\n```\n\n### Client Options\n\n```typescript\ninterface ClientOptions {\n  timeout?: number;                    // Request timeout in milliseconds\n  headers?: Record\u003cstring, string\u003e;    // Custom headers\n  auth?: {\n    username?: string;\n    password?: string;\n    token?: string;\n  };\n  proxy?: {\n    host: string;\n    port: number;\n    auth?: {\n      username: string;\n      password: string;\n    };\n  };\n  cookies?: string;                    // Cookie string\n  ssl?: {\n    rejectUnauthorized?: boolean;\n    ca?: string;\n    cert?: string;\n    key?: string;\n  };\n  userAgent?: string;                  // Custom User-Agent\n  impersonate?: 'chrome' | 'safari' | 'edge' | 'firefox' | 'okhttp';\n  impersonate_os?: 'android' | 'ios' | 'linux' | 'macos' | 'windows';\n}\n```\n\n### HTTP Methods\n\nAll clients support the following methods:\n\n- `get(url, options?)` - GET request\n- `post(url, data?, options?)` - POST request\n- `put(url, data?, options?)` - PUT request\n- `patch(url, data?, options?)` - PATCH request\n- `delete(url, options?)` - DELETE request\n- `head(url, options?)` - HEAD request\n- `options(url, options?)` - OPTIONS request\n\n### Response Object\n\n```typescript\ninterface Response {\n  status: number;\n  headers: Record\u003cstring, string | string[] | undefined\u003e;\n  data: string;\n\n  json\u003cT = any\u003e(): T;    // Parse JSON response\n  text(): string;        // Get text response\n}\n```\n\n### Error Types\n\n- `RequestError` - General request errors\n- `TimeoutError` - Request timeout errors\n\n## Browser Impersonation\n\nTrimpTS can impersonate various browsers and operating systems:\n\n```typescript\n// Chrome on Windows\nconst client = new AsyncClient({\n  impersonate: 'chrome',\n  impersonate_os: 'windows'\n});\n\n// Safari on macOS\nconst client = new AsyncClient({\n  impersonate: 'safari',\n  impersonate_os: 'macos'\n});\n\n// Firefox on Linux\nconst client = new AsyncClient({\n  impersonate: 'firefox',\n  impersonate_os: 'linux'\n});\n```\n\n## Examples\n\n### Basic Authentication\n\n```typescript\nconst client = new AsyncClient({\n  auth: {\n    username: 'user',\n    password: 'pass'\n  }\n});\n```\n\n### Bearer Token Authentication\n\n```typescript\nconst client = new AsyncClient({\n  auth: {\n    token: 'your-jwt-token'\n  }\n});\n```\n\n### Custom Headers and Timeout\n\n```typescript\nconst response = await client.get('https://api.example.com/data', {\n  headers: {\n    'X-API-Key': 'your-api-key'\n  },\n  timeout: 10000\n});\n```\n\n### POST with JSON Data\n\n```typescript\nconst response = await client.post('https://api.example.com/users', {\n  name: 'John Doe',\n  email: 'john@example.com'\n});\n```\n\n### SSL Configuration\n\n```typescript\nconst client = new AsyncClient({\n  ssl: {\n    rejectUnauthorized: false,  // For self-signed certificates\n    ca: fs.readFileSync('ca.pem'),\n    cert: fs.readFileSync('cert.pem'),\n    key: fs.readFileSync('key.pem')\n  }\n});\n```\n\n## Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request.\n\n## License\n\nMIT License - see the [LICENSE](LICENSE) file for details.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftrose%2Ftrimp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftrose%2Ftrimp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftrose%2Ftrimp/lists"}